mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix global search would fail if last message had no peer
This commit is contained in:
parent
4683e83287
commit
233daafd96
|
@ -240,7 +240,11 @@ class _MessagesIter(RequestIter):
|
||||||
self.request.offset_date = last_message.date
|
self.request.offset_date = last_message.date
|
||||||
|
|
||||||
if isinstance(self.request, functions.messages.SearchGlobalRequest):
|
if isinstance(self.request, functions.messages.SearchGlobalRequest):
|
||||||
|
if last_message.input_chat:
|
||||||
self.request.offset_peer = last_message.input_chat
|
self.request.offset_peer = last_message.input_chat
|
||||||
|
else:
|
||||||
|
self.request.offset_peer = types.InputPeerEmpty()
|
||||||
|
|
||||||
self.request.offset_rate = getattr(response, 'next_rate', None)
|
self.request.offset_rate = getattr(response, 'next_rate', None)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user