Locally check dialog's offset date (#1043)

Telegram ignores the parameter if it's alone.
This commit is contained in:
Lonami Exo 2019-01-03 22:35:07 +01:00
parent c51a17bf9a
commit 8c0250f775

View File

@ -93,6 +93,13 @@ class DialogMethods(UserMethods):
r.dialogs = r.dialogs[:limit]
for d in r.dialogs:
if offset_date:
date = getattr(messages.get(
d.top_message, None), 'date', None)
if not date or date.timestamp() > offset_date.timestamp():
continue
peer_id = utils.get_peer_id(d.peer)
if peer_id not in seen:
seen.add(peer_id)