Fix date empty when getting difference

This commit is contained in:
Lonami Exo 2023-09-13 17:35:15 +02:00
parent 7ce0b2f940
commit 7325718f0e
2 changed files with 6 additions and 5 deletions

View File

@ -175,7 +175,7 @@ class MessageBox:
map: dict = _sentinel, # entry -> state
# Additional fields beyond PTS needed by `ENTRY_ACCOUNT`.
date: datetime.datetime = epoch(),
date: datetime.datetime = epoch() + datetime.timedelta(seconds=1),
seq: int = NO_SEQ,
# Holds the entry with the closest deadline (optimization to avoid recalculating the minimum deadline).
@ -478,7 +478,8 @@ class MessageBox:
if any_pts_applied[0]:
if __debug__:
self._trace('Updating seq as local pts was updated too')
self.date = date
if date != epoch():
self.date = date
if seq != NO_SEQ:
self.seq = seq
@ -689,7 +690,7 @@ class MessageBox:
updates=diff.other_updates,
users=diff.users,
chats=diff.chats,
date=epoch() + datetime.timedelta(seconds=1),
date=epoch(),
seq=NO_SEQ, # this way date is not used
), chat_hashes, updates)
@ -798,7 +799,7 @@ class MessageBox:
updates=diff.other_updates,
users=diff.users,
chats=diff.chats,
date=epoch() + datetime.timedelta(seconds=1),
date=epoch(),
seq=NO_SEQ, # this way date is not used
), chat_hashes, updates)

View File

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