mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-30 05:13:45 +03:00
Fix time_offset not being used at all after BadMsgNotification
Telegram would refuse to reply any further unless the message ID had the correct time (causing some behaviour like .connect() never connecting, due to the first request being sent always failing). The fix was to use time_offset when calculating the message ID, while this was right, it wasn't in use.
This commit is contained in:
parent
32b92b32a7
commit
6c73538bd4
|
@ -311,7 +311,7 @@ class Session:
|
||||||
now = time.time()
|
now = time.time()
|
||||||
nanoseconds = int((now - int(now)) * 1e+9)
|
nanoseconds = int((now - int(now)) * 1e+9)
|
||||||
# "message identifiers are divisible by 4"
|
# "message identifiers are divisible by 4"
|
||||||
new_msg_id = (int(now) << 32) | (nanoseconds << 2)
|
new_msg_id = ((int(now) + self.time_offset) << 32) | (nanoseconds << 2)
|
||||||
|
|
||||||
with self._msg_id_lock:
|
with self._msg_id_lock:
|
||||||
if self._last_msg_id >= new_msg_id:
|
if self._last_msg_id >= new_msg_id:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user