Fixed logout

This commit is contained in:
Daniil Gentili 2017-08-29 17:41:26 +02:00
parent fefbe41f29
commit 379138c476

View File

@ -19,9 +19,6 @@ trait Login
{
public function logout()
{
if (!$this->method_call('auth.logOut', [], ['datacenter' => $this->datacenter->curdc])) {
throw new \danog\MadelineProto\Exception('An error occurred while logging out!');
}
$this->authorized = self::NOT_LOGGED_IN;
$this->authorization = null;
$this->updates = [];
@ -30,6 +27,9 @@ trait Login
$this->users = [];
$this->state = [];
if (!$this->method_call('auth.logOut', [], ['datacenter' => $this->datacenter->curdc])) {
throw new \danog\MadelineProto\Exception('An error occurred while logging out!');
}
\danog\MadelineProto\Logger::log(['Logged out successfully!'], \danog\MadelineProto\Logger::NOTICE);
return true;