Send getState upon successful reconnection

This commit is contained in:
Lonami Exo
2018-06-27 19:40:32 +02:00
parent c0412e4410
commit a6782ac6ea
3 changed files with 24 additions and 5 deletions

View File

@@ -1,10 +1,10 @@
import abc
import asyncio
import inspect
import logging
import platform
import sys
import time
import inspect
from datetime import timedelta, datetime
from .. import version
@@ -209,7 +209,8 @@ class TelegramBaseClient(abc.ABC):
retries=self._connection_retries,
auto_reconnect=self._auto_reconnect,
update_callback=self._handle_update,
auth_key_callback=self._auth_key_callback
auth_key_callback=self._auth_key_callback,
auto_reconnect_callback=self._handle_auto_reconnect
)
# Cache :tl:`ExportedAuthorization` as ``dc_id: MTProtoState``
@@ -456,4 +457,8 @@ class TelegramBaseClient(abc.ABC):
def _update_loop(self):
raise NotImplementedError
@abc.abstractmethod
async def _handle_auto_reconnect(self):
raise NotImplementedError
# endregion