passign date time instead of int

This commit is contained in:
Shubham Kumar 2023-08-29 21:46:37 +05:30 committed by GitHub
parent 77e20e382f
commit df2078d1b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,7 +210,7 @@ class MessageBox:
# it when using `python -O`. Probably unnecessary, but it's nice to avoid
# paying the cost for something that is not used.
self._log.log(LOG_LEVEL_TRACE, 'Current MessageBox state: seq = %r, date = %s, map = %r',
self.seq, self.date.isoformat() if self.date and isinstance(self.date, datetime.datetime) else None, self.map)
self.seq, self.date.isoformat(), self.map)
self._log.log(LOG_LEVEL_TRACE, msg, *args, **kwargs)
# region Creation, querying, and setting base state.
@ -423,7 +423,7 @@ class MessageBox:
if __debug__:
self._trace('Processing updates with seq = %r, seq_start = %r, date = %s: %s',
seq, seq_start, date.isoformat() if date and isinstance(date, datetime.datetime) else None, updates)
seq, seq_start, date.isoformat() if date else None, updates)
if date is None:
# updatesTooLong is the only one with no date (we treat it as a gap)
@ -798,7 +798,7 @@ class MessageBox:
updates=diff.other_updates,
users=diff.users,
chats=diff.chats,
date=1, # anything not-None
date=epoch(),
seq=NO_SEQ, # this way date is not used
), chat_hashes, updates)
@ -828,4 +828,4 @@ class MessageBox:
else:
raise RuntimeError('Unknown reason to end channel difference')
# endregion Getting and applying channel difference.
# endregion Getting and applying channel difference.