Fix get_dialogs was not filling channels pts

This commit is contained in:
Lonami Exo 2022-09-27 11:31:41 +02:00
parent 105a7a7c56
commit bb98f4e68c
2 changed files with 4 additions and 2 deletions

View File

@ -58,6 +58,8 @@ class _DialogsIter(RequestIter):
for x in itertools.chain(r.users, r.chats)
if not isinstance(x, (types.UserEmpty, types.ChatEmpty))}
self.client._mb_entity_cache.extend(r.users, r.chats)
messages = {}
for m in r.messages:
m._finish_init(self.client, entities, None)
@ -82,7 +84,8 @@ class _DialogsIter(RequestIter):
cd = custom.Dialog(self.client, d, entities, message)
if cd.dialog.pts:
self.client._channel_pts[cd.id] = cd.dialog.pts
self.client._message_box.try_set_channel_state(
utils.get_peer_id(d.peer, add_mark=False), cd.dialog.pts)
if not self.ignore_migrated or getattr(
cd.entity, 'migrated_to', None) is None:

View File

@ -390,7 +390,6 @@ class TelegramBaseClient(abc.ABC):
self._updates_handle = None
self._keepalive_handle = None
self._last_request = time.time()
self._channel_pts = {}
self._no_updates = not receive_updates
# Used for non-sequential updates, in order to terminate all pending tasks on disconnect.