From 059b24d926fca3c24cac6d5fa6b0f3c92332577d Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 13 Jun 2019 20:05:39 +0200 Subject: [PATCH] Reset update state on logout --- src/danog/MadelineProto/MTProtoTools/ResponseHandler.php | 6 +++++- src/danog/MadelineProto/Wrappers/Login.php | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php index f6bf7e81..a23ab967 100644 --- a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php @@ -409,13 +409,15 @@ trait ResponseHandler $this->logger->logger("Telegram's flood prevention system suspended this account.", \danog\MadelineProto\Logger::ERROR); $this->logger->logger('To continue, manual verification is required.', \danog\MadelineProto\Logger::FATAL_ERROR); $phone = isset($this->authorization['user']['phone']) ? '+'.$this->authorization['user']['phone'] : 'you are currently using'; - $this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number '.$phone.', and quickly describe what will you do with this phone number.', \danog\MadelineProto\Logger::FATAL_ERROR); + $this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number '.$phone.', and shortly describe what will you do with this phone number.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('Then login again.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('If you intentionally deleted this account, ignore this message.', \danog\MadelineProto\Logger::FATAL_ERROR); } $this->authorized = self::NOT_LOGGED_IN; $this->authorization = null; + $this->got_state = false; + $this->channels_state = false; $this->callFork((function () use ($datacenter, &$request, &$response) { yield $this->init_authorization_async(); @@ -463,6 +465,8 @@ trait ResponseHandler $this->authorized = self::NOT_LOGGED_IN; $this->authorization = null; + $this->got_state = false; + $this->channels_state = false; $this->callFork((function () use ($datacenter, &$request, &$response) { yield $this->init_authorization_async(); diff --git a/src/danog/MadelineProto/Wrappers/Login.php b/src/danog/MadelineProto/Wrappers/Login.php index 2b15c5cc..b14f0a00 100644 --- a/src/danog/MadelineProto/Wrappers/Login.php +++ b/src/danog/MadelineProto/Wrappers/Login.php @@ -38,7 +38,8 @@ trait Login $this->secret_chats = []; $this->chats = []; $this->users = []; - $this->state = []; + $this->channels_state = null; + $this->got_state = false; $this->tos = ['expires' => 0, 'accepted' => true]; yield $this->method_call_async_read('auth.logOut', [], ['datacenter' => $this->datacenter->curdc]); $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['logout_ok'], \danog\MadelineProto\Logger::NOTICE);