mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 19:33:45 +03:00
Fix UpdateState calling handlers with updates with lower pts
This commit is contained in:
parent
060b8a8b9c
commit
1d3273a306
|
@ -75,9 +75,13 @@ class UpdateState:
|
||||||
with self._updates_lock:
|
with self._updates_lock:
|
||||||
if isinstance(update, tl.updates.State):
|
if isinstance(update, tl.updates.State):
|
||||||
self._state = update
|
self._state = update
|
||||||
elif not hasattr(update, 'pts') or update.pts > self._state.pts:
|
return # Nothing else to be done
|
||||||
self._state.pts = getattr(update, 'pts', self._state.pts)
|
|
||||||
|
|
||||||
|
pts = getattr(update, 'pts', self._state.pts)
|
||||||
|
if pts <= self._state.pts:
|
||||||
|
return # We already handled this update
|
||||||
|
|
||||||
|
self._state.pts = pts
|
||||||
if self._polling:
|
if self._polling:
|
||||||
self._updates.append(update)
|
self._updates.append(update)
|
||||||
self._updates_available.set()
|
self._updates_available.set()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user