This commit is contained in:
Nikolay 2017-10-13 09:30:23 +03:00 committed by GitHub
parent bec5f9fb89
commit cf7934e4b2

View File

@ -253,7 +253,8 @@ class TelegramClient(TelegramBareClient):
if limit is None: if limit is None:
limit = float('inf') limit = float('inf')
dialogs = {} # Use Dialog.top_message as identifier to avoid dupes i = 0
dialogs = {} # Use sequence numeration as identifier to avoid dupes
messages = {} # Used later for sorting TODO also return these? messages = {} # Used later for sorting TODO also return these?
entities = {} entities = {}
while len(dialogs) < limit: while len(dialogs) < limit:
@ -268,7 +269,8 @@ class TelegramClient(TelegramBareClient):
break break
for d in r.dialogs: for d in r.dialogs:
dialogs[d.top_message] = d dialogs[i] = d
i += 1
for m in r.messages: for m in r.messages:
messages[m.id] = m messages[m.id] = m