mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 11:23:46 +03:00
Fix searching messages in reverse
This commit is contained in:
parent
e3991fadd5
commit
35dc46ffb0
|
@ -214,7 +214,11 @@ class _MessagesIter(RequestIter):
|
|||
self.request.offset_id += 1
|
||||
|
||||
if isinstance(self.request, functions.messages.SearchRequest):
|
||||
self.request.max_date = last_message.date
|
||||
# Unlike getHistory and searchGlobal that use *offset* date,
|
||||
# this is *max* date. This means that doing a search in reverse
|
||||
# will break it. Since it's not really needed once we're going
|
||||
# (only for the first request), it's safe to just clear it off.
|
||||
self.request.max_date = None
|
||||
else:
|
||||
# getHistory and searchGlobal call it offset_date
|
||||
self.request.offset_date = last_message.date
|
||||
|
|
Loading…
Reference in New Issue
Block a user