mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 11:10:18 +03:00
Fix global searching with from_user or filter
This commit is contained in:
parent
0f1f655e5d
commit
a710caf86e
|
@ -86,6 +86,7 @@ class _MessagesIter(RequestIter):
|
|||
filter = types.InputMessagesFilterEmpty()
|
||||
|
||||
# Telegram completely ignores `from_id` in private chats
|
||||
if self.entity:
|
||||
ty = helpers._entity_type(self.entity)
|
||||
if ty == helpers._EntityType.USER:
|
||||
# Don't bother sending `from_user` (it's ignored anyway),
|
||||
|
@ -95,6 +96,8 @@ class _MessagesIter(RequestIter):
|
|||
# Do send `from_user` to do the filtering server-side,
|
||||
# and set `from_id` to None to avoid checking it locally.
|
||||
self.from_id = None
|
||||
else:
|
||||
self.from_id = None
|
||||
|
||||
self.request = functions.messages.SearchRequest(
|
||||
peer=self.entity,
|
||||
|
|
Loading…
Reference in New Issue
Block a user