Fix search with offset_date causing infinite recursion

Bug introduced by 668dcd5. Closes #1606.
This commit is contained in:
Lonami Exo 2020-10-25 10:33:36 +01:00
parent aac4d03a70
commit e7f174cdc8

View File

@ -133,7 +133,8 @@ class _MessagesIter(RequestIter):
#
# Even better, using `filter` and `from_id` seems to always
# trigger `RPC_CALL_FAIL` which is "internal issues"...
if filter and offset_date and not search and not offset_id:
if not isinstance(filter, types.InputMessagesFilterEmpty) \
and offset_date and not search and not offset_id:
async for m in self.client.iter_messages(
self.entity, 1, offset_date=offset_date):
self.request.offset_id = m.id + 1