mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
Rename .entities -> ._entities from 7e9d19d
to avoid collision
This commit is contained in:
@@ -129,12 +129,9 @@ class UpdateState:
|
||||
# After running the script for over an hour and receiving over
|
||||
# 1000 updates, the only duplicates received were users going
|
||||
# online or offline. We can trust the server until new reports.
|
||||
#
|
||||
# TODO Note somewhere that all updates are modified to include
|
||||
# .entities, which is a dictionary you can access but may be empty.
|
||||
# This should only be used as read-only.
|
||||
if isinstance(update, tl.UpdateShort):
|
||||
update.update.entities = {}
|
||||
update.update._entities = {}
|
||||
self._updates.put(update.update)
|
||||
# Expand "Updates" into "Update", and pass these to callbacks.
|
||||
# Since .users and .chats have already been processed, we
|
||||
@@ -143,9 +140,9 @@ class UpdateState:
|
||||
entities = {utils.get_peer_id(x): x for x in
|
||||
itertools.chain(update.users, update.chats)}
|
||||
for u in update.updates:
|
||||
u.entities = entities
|
||||
u._entities = entities
|
||||
self._updates.put(u)
|
||||
# TODO Handle "tl.UpdatesTooLong"
|
||||
else:
|
||||
update.entities = {}
|
||||
update._entities = {}
|
||||
self._updates.put(update)
|
||||
|
Reference in New Issue
Block a user