Save pts and date only if there is something to save

This commit is contained in:
Lonami Exo 2019-05-05 22:13:02 +02:00
parent 5ed7bf7815
commit 7d0efcf50f
2 changed files with 9 additions and 8 deletions

View File

@ -419,13 +419,14 @@ class TelegramBaseClient(abc.ABC):
self._updates_queue.clear() self._updates_queue.clear()
pts, date = self._state_cache[None] pts, date = self._state_cache[None]
self.session.set_update_state(0, types.updates.State( if pts and date:
pts=pts, self.session.set_update_state(0, types.updates.State(
qts=0, pts=pts,
date=date, qts=0,
seq=0, date=date,
unread_count=0 seq=0,
)) unread_count=0
))
self.session.close() self.session.close()

View File

@ -1,3 +1,3 @@
# Versions should comply with PEP440. # Versions should comply with PEP440.
# This line is parsed in setup.py: # This line is parsed in setup.py:
__version__ = '1.7.5' __version__ = '1.7.6'