mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-17 03:51:05 +03:00
Use peer as key instead top_message on .get_dialogs (fix #329)
This commit is contained in:
parent
f4b8772a85
commit
9907d763a8
|
@ -253,7 +253,7 @@ 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
|
dialogs = {} # Use peer id 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 +268,7 @@ class TelegramClient(TelegramBareClient):
|
||||||
break
|
break
|
||||||
|
|
||||||
for d in r.dialogs:
|
for d in r.dialogs:
|
||||||
dialogs[d.top_message] = d
|
dialogs[utils.get_peer_id(d.peer, True)] = d
|
||||||
for m in r.messages:
|
for m in r.messages:
|
||||||
messages[m.id] = m
|
messages[m.id] = m
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user