Persist updates.State upon disconnection

This commit is contained in:
Lonami Exo
2018-04-25 13:37:29 +02:00
parent e2a0de1913
commit 2a00bcaa12
5 changed files with 49 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ class MemorySession(Session):
self._files = {}
self._entities = set()
self._update_states = {}
def set_dc(self, dc_id, server_address, port):
self._dc_id = dc_id or 0
@@ -57,6 +58,12 @@ class MemorySession(Session):
def auth_key(self, value):
self._auth_key = value
def get_update_state(self, entity_id):
return self._update_states.get(entity_id, None)
def set_update_state(self, entity_id, state):
self._update_states[entity_id] = state
def close(self):
pass