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,14 +86,17 @@ class _MessagesIter(RequestIter):
|
||||||
filter = types.InputMessagesFilterEmpty()
|
filter = types.InputMessagesFilterEmpty()
|
||||||
|
|
||||||
# Telegram completely ignores `from_id` in private chats
|
# Telegram completely ignores `from_id` in private chats
|
||||||
ty = helpers._entity_type(self.entity)
|
if self.entity:
|
||||||
if ty == helpers._EntityType.USER:
|
ty = helpers._entity_type(self.entity)
|
||||||
# Don't bother sending `from_user` (it's ignored anyway),
|
if ty == helpers._EntityType.USER:
|
||||||
# but keep `from_id` defined above to check it locally.
|
# Don't bother sending `from_user` (it's ignored anyway),
|
||||||
from_user = None
|
# but keep `from_id` defined above to check it locally.
|
||||||
|
from_user = None
|
||||||
|
else:
|
||||||
|
# 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:
|
else:
|
||||||
# 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
|
self.from_id = None
|
||||||
|
|
||||||
self.request = functions.messages.SearchRequest(
|
self.request = functions.messages.SearchRequest(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user