Fix .get_dialogs() failing due to IDs being marked

Also removed utils.find_user_or_chat to prevent this from
happening again. Using a dict {marked_id: entity} is better.
This commit is contained in:
Lonami Exo
2017-12-28 13:21:35 +01:00
parent c23c0a557a
commit 7ed3be8e6f
2 changed files with 2 additions and 25 deletions

View File

@@ -338,9 +338,8 @@ class TelegramClient(TelegramBareClient):
break
offset_date = r.messages[-1].date
offset_peer = utils.find_user_or_chat(
r.dialogs[-1].peer, entities, entities
)
offset_peer = entities[
utils.get_peer_id(r.dialogs[-1].peer, add_mark=True)]
offset_id = r.messages[-1].id & 4294967296 # Telegram/danog magic
dialogs = UserList(dialogs.values())