From 379138c476c4ee073c0476a4204b9b6a788cee25 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 29 Aug 2017 17:41:26 +0200 Subject: [PATCH] Fixed logout --- src/danog/MadelineProto/Wrappers/Login.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/danog/MadelineProto/Wrappers/Login.php b/src/danog/MadelineProto/Wrappers/Login.php index 8d6bab62..59da2dbd 100644 --- a/src/danog/MadelineProto/Wrappers/Login.php +++ b/src/danog/MadelineProto/Wrappers/Login.php @@ -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;