diff --git a/telethon/client/dialogs.py b/telethon/client/dialogs.py index 8c0860fc..a2d86d11 100644 --- a/telethon/client/dialogs.py +++ b/telethon/client/dialogs.py @@ -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: diff --git a/telethon/client/telegrambaseclient.py b/telethon/client/telegrambaseclient.py index b5c31c05..426fe5e6 100644 --- a/telethon/client/telegrambaseclient.py +++ b/telethon/client/telegrambaseclient.py @@ -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.