mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-18 12:30:59 +03:00
Fix updating offset
This commit is contained in:
parent
f765f73fa3
commit
e3991fadd5
|
@ -173,10 +173,10 @@ class _MessagesIter(RequestIter):
|
||||||
if len(r.messages) < self.request.limit:
|
if len(r.messages) < self.request.limit:
|
||||||
self.left = len(result)
|
self.left = len(result)
|
||||||
|
|
||||||
# Get the first message that's not empty (in some rare cases
|
# Get the last message that's not empty (in some rare cases
|
||||||
# it can happen that the last message is :tl:`MessageEmpty`)
|
# it can happen that the last message is :tl:`MessageEmpty`)
|
||||||
if result:
|
if result:
|
||||||
self._update_offset(result[0])
|
self._update_offset(result[-1])
|
||||||
else:
|
else:
|
||||||
# There are some cases where all the messages we get start
|
# There are some cases where all the messages we get start
|
||||||
# being empty. This can happen on migrated mega-groups if
|
# being empty. This can happen on migrated mega-groups if
|
||||||
|
|
Loading…
Reference in New Issue
Block a user