Attempt at fixing msg_id too low/high (#95)

This commit is contained in:
Lonami Exo
2017-05-26 16:39:59 +02:00
parent 289baa0fed
commit 7f84374e98
2 changed files with 16 additions and 1 deletions

View File

@@ -65,3 +65,9 @@ class Session:
self.last_message_id = new_msg_id
return new_msg_id
def update_time_offset(self, correct_msg_id):
"""Updates the time offset based on a known correct message ID"""
now = int(time.time())
correct = correct_msg_id >> 32
self.time_offset = correct - now