-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
Introduced by 668dcd5 (this commit did change a lot more than it should have); the condition for search was never updated to account for the non-None value. Closes #1693.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,8 @@ async def _init( | |
|
||
if filter is None: | ||
filter = types.InputMessagesFilterEmpty() | ||
else: | ||
filter = filter() if isinstance(filter, type) else filter | ||
|
||
if not self.entity: | ||
self.request = functions.messages.SearchGlobalRequest( | ||
|
@@ -94,7 +96,7 @@ async def _init( | |
min_id=0, | ||
hash=0 | ||
) | ||
elif search is not None or filter or from_user: | ||
elif search is not None or not isinstance(filter, types.InputMessagesFilterEmpty) or from_user: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Lonami
Author
Member
|
||
# Telegram completely ignores `from_id` in private chats | ||
ty = helpers._entity_type(self.entity) | ||
if ty == helpers._EntityType.USER: | ||
|
@@ -109,7 +111,7 @@ async def _init( | |
self.request = functions.messages.SearchRequest( | ||
peer=self.entity, | ||
q=search or '', | ||
filter=filter() if isinstance(filter, type) else filter, | ||
filter=filter, | ||
min_date=None, | ||
max_date=offset_date, | ||
offset_id=offset_id, | ||
|
Wouldn't
not isinstance(filter, types.InputMessagesFilterEmpty)
always beTrue
iffilter == None
?