Reset update state on logout

This commit is contained in:
Daniil Gentili 2019-06-13 20:05:39 +02:00
parent c09488aa12
commit 059b24d926
2 changed files with 7 additions and 2 deletions

View File

@ -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();

View File

@ -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);