Fix StateCache accessing None to_id and add logging (#1160)

This commit is contained in:
Lonami Exo
2019-04-22 12:24:45 +02:00
parent fee0923dd1
commit a151d24951
3 changed files with 14 additions and 8 deletions

View File

@@ -308,7 +308,8 @@ class TelegramBaseClient(abc.ABC):
# Update state (for catching up after a disconnection)
# TODO Get state from channels too
self._state_cache = StateCache(self.session.get_update_state(0))
self._state_cache = StateCache(
self.session.get_update_state(0), self._log)
# Some further state for subclasses
self._event_builders = []

View File

@@ -213,7 +213,7 @@ class UpdateMethods(UserMethods):
self._state_cache.update(update)
def _process_update(self, update, entities=None):
update._channel_id = StateCache.get_channel_id(update)
update._channel_id = self._state_cache.get_channel_id(update)
update._pts_date = self._state_cache[update._channel_id]
update._entities = entities or {}
if self._updates_queue is None: