Implemnet chat hash cache and adapting updates

This commit is contained in:
Lonami Exo
2023-08-31 17:36:08 +02:00
parent 7c112d8b0f
commit c77c10b48f
8 changed files with 697 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
from telethon._impl.session.chat.packed import PackedChat, PackedType
def test_hash_optional() -> None:
for ty in PackedType:
pc = PackedChat(ty, 123, 456789)
assert PackedChat.from_bytes(bytes(pc)) == pc
pc = PackedChat(ty, 987, None)
assert PackedChat.from_bytes(bytes(pc)) == pc