Fix process_updates=True preventing new sessions from signing in

This commit is contained in:
Lonami Exo 2017-09-17 18:13:58 +02:00
parent 58fe39f060
commit 940dfe6816

View File

@ -967,7 +967,11 @@ class TelegramClient(TelegramBareClient):
called automatically on connection if self.updates.enabled = True,
otherwise it should be called manually after enabling updates.
"""
self.updates.process(self(GetStateRequest()))
try:
self.updates.process(self(GetStateRequest()))
return True
except UnauthorizedError:
return False
def add_update_handler(self, handler):
"""Adds an update handler (a function which takes a TLObject,