mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 02:43:45 +03:00
Handle get_difference case for secret chats
This commit is contained in:
parent
af56429e78
commit
d5bfb71e10
|
@ -494,7 +494,7 @@ class MessageBox:
|
|||
|
||||
# Return the request that needs to be made to get the difference, if any.
|
||||
def get_difference(self):
|
||||
entry = ENTRY_ACCOUNT
|
||||
for entry in (ENTRY_ACCOUNT, ENTRY_SECRET):
|
||||
if entry in self.getting_diff_for:
|
||||
if entry in self.map:
|
||||
return fn.updates.GetDifferenceRequest(
|
||||
|
@ -519,9 +519,11 @@ class MessageBox:
|
|||
self.date = diff.date
|
||||
self.seq = diff.seq
|
||||
self.end_get_diff(ENTRY_ACCOUNT)
|
||||
self.end_get_diff(ENTRY_SECRET)
|
||||
return [], [], []
|
||||
elif isinstance(diff, tl.updates.Difference):
|
||||
self.end_get_diff(ENTRY_ACCOUNT)
|
||||
self.end_get_diff(ENTRY_SECRET)
|
||||
chat_hashes.extend(diff.users, diff.chats)
|
||||
return self.apply_difference_type(diff)
|
||||
elif isinstance(diff, tl.updates.DifferenceSlice):
|
||||
|
@ -531,6 +533,7 @@ class MessageBox:
|
|||
# TODO when are deadlines reset if we update the map??
|
||||
self.map[ENTRY_ACCOUNT].pts = diff.pts
|
||||
self.end_get_diff(ENTRY_ACCOUNT)
|
||||
self.end_get_diff(ENTRY_SECRET)
|
||||
return [], [], []
|
||||
|
||||
def apply_difference_type(
|
||||
|
|
Loading…
Reference in New Issue
Block a user