mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 19:20:09 +03:00
Fix searching with from_user or filter
This commit is contained in:
parent
0f1f655e5d
commit
f11a02b5c1
|
@ -73,7 +73,7 @@ class _MessagesIter(RequestIter):
|
||||||
if not self.entity and (filter or from_user):
|
if not self.entity and (filter or from_user):
|
||||||
self.entity = types.InputPeerEmpty()
|
self.entity = types.InputPeerEmpty()
|
||||||
|
|
||||||
if not self.entity:
|
if not self.entity or isinstance(self.entity, types.InputPeerEmpty):
|
||||||
self.request = functions.messages.SearchGlobalRequest(
|
self.request = functions.messages.SearchGlobalRequest(
|
||||||
q=search or '',
|
q=search or '',
|
||||||
offset_rate=offset_date,
|
offset_rate=offset_date,
|
||||||
|
@ -207,7 +207,7 @@ class _MessagesIter(RequestIter):
|
||||||
it should be ignored (and avoid loading more chunks).
|
it should be ignored (and avoid loading more chunks).
|
||||||
"""
|
"""
|
||||||
# No entity means message IDs between chats may vary
|
# No entity means message IDs between chats may vary
|
||||||
if self.entity:
|
if self.entity and not isinstance(self.entity, types.InputPeerEmpty):
|
||||||
if self.reverse:
|
if self.reverse:
|
||||||
if message.id <= self.last_id or message.id >= self.max_id:
|
if message.id <= self.last_id or message.id >= self.max_id:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user