Fix slicing dialogs was turning UserList into list

This commit is contained in:
Lonami Exo 2017-12-28 14:55:02 +01:00
parent 55b67b65a1
commit 50d413b1c9

View File

@ -341,9 +341,11 @@ class TelegramClient(TelegramBareClient):
offset_peer = entities[utils.get_peer_id(r.dialogs[-1].peer)]
offset_id = r.messages[-1].id & 4294967296 # Telegram/danog magic
dialogs = UserList(dialogs.values())
dialogs = UserList(
itertools.islice(dialogs.values(), min(limit, len(dialogs)))
)
dialogs.total = total_count
return dialogs[:limit] if limit < float('inf') else dialogs
return dialogs
def get_drafts(self): # TODO: Ability to provide a `filter`
"""