From 5f0695d21b2415eaa00fbfbd04d88fc0046ae296 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 18 Apr 2025 18:40:53 +0200 Subject: [PATCH] Fix time offset check was in opposite branch --- telethon/network/mtprotostate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/network/mtprotostate.py b/telethon/network/mtprotostate.py index 1444ac5b..49fb7478 100644 --- a/telethon/network/mtprotostate.py +++ b/telethon/network/mtprotostate.py @@ -203,13 +203,13 @@ class MTProtoState: # messages to change server_salt and notifications about invalid time on the client." # # This means we skip the time check for certain types of messages. - if obj.CONSTRUCTOR_ID not in (BadServerSalt.CONSTRUCTOR_ID, BadMsgNotification.CONSTRUCTOR_ID): + if obj.CONSTRUCTOR_ID in (BadServerSalt.CONSTRUCTOR_ID, BadMsgNotification.CONSTRUCTOR_ID): if not self._highest_remote_id and not self.time_offset: # If the first message we receive is a bad notification, take this opportunity # to adjust the time offset. Assume it will remain stable afterwards. Updating # the offset unconditionally would make the next checks pointless. self.update_time_offset(remote_msg_id) - + else: remote_msg_time = remote_msg_id >> 32 time_delta = (now + self.time_offset) - remote_msg_time