mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 21:24:35 +03:00
Don't mark the user as connected until successfull connection
The idea behind distinguishing between the user being connected and the actual connection having been made was to support retries while the user decided to connect, even if the connection wasn't made yet. The problem is that _user_connected is used directly to tell whether the sender is connected or not which will be wrong if an exception occurs on the initial connection. Since the logic retry isn't used there we can simply mark as connected once a successfull connection is made.
This commit is contained in:
parent
229969192a
commit
95cf873bad
|
@ -136,8 +136,8 @@ class MTProtoSender:
|
|||
return
|
||||
|
||||
self._connection = connection
|
||||
self._user_connected = True
|
||||
await self._connect()
|
||||
self._user_connected = True
|
||||
|
||||
def is_connected(self):
|
||||
return self._user_connected
|
||||
|
|
Loading…
Reference in New Issue
Block a user