Rename .entities -> ._entities from 7e9d19d to avoid collision

This commit is contained in:
Lonami Exo
2018-03-29 00:56:05 +02:00
parent 395e702586
commit dede5520dd
2 changed files with 9 additions and 12 deletions

View File

@@ -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)