mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
* reconnect in TelegramClient.connect() forces reconnect only if client was connected
This commit is contained in:
parent
0e44657963
commit
8753df27ed
|
@ -90,7 +90,7 @@ class TelegramClient:
|
||||||
Note that authenticating to the Telegram servers is not the same as authenticating
|
Note that authenticating to the Telegram servers is not the same as authenticating
|
||||||
the app, which requires to send a code first."""
|
the app, which requires to send a code first."""
|
||||||
try:
|
try:
|
||||||
if not self.session.auth_key or reconnect:
|
if not self.session.auth_key or (reconnect and self.sender is not None):
|
||||||
self.session.auth_key, self.session.time_offset = \
|
self.session.auth_key, self.session.time_offset = \
|
||||||
authenticator.do_authentication(self.transport)
|
authenticator.do_authentication(self.transport)
|
||||||
|
|
||||||
|
@ -146,6 +146,7 @@ class TelegramClient:
|
||||||
"""Disconnects from the Telegram server **and pauses all the spawned threads**"""
|
"""Disconnects from the Telegram server **and pauses all the spawned threads**"""
|
||||||
if self.sender:
|
if self.sender:
|
||||||
self.sender.disconnect()
|
self.sender.disconnect()
|
||||||
|
self.sender = None
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user