mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Avoid duplicate del in Conversation._on_read
This commit is contained in:
parent
cd51c9e47c
commit
00aa0a4bf1
|
@ -416,16 +416,11 @@ class Conversation(ChatGetter):
|
|||
|
||||
self._last_read = event.max_id
|
||||
|
||||
remove_reads = []
|
||||
for msg_id, pending in list(self._pending_reads.items()):
|
||||
if msg_id >= self._last_read:
|
||||
remove_reads.append(msg_id)
|
||||
pending.set_result(True)
|
||||
del self._pending_reads[msg_id]
|
||||
|
||||
for to_remove in remove_reads:
|
||||
del self._pending_reads[to_remove]
|
||||
|
||||
def _get_message_id(self, message):
|
||||
if message is not None: # 0 is valid but false-y, check for None
|
||||
return message if isinstance(message, int) else message.id
|
||||
|
|
Loading…
Reference in New Issue
Block a user