From 209dde1a8930a8da6420fc7a52147596ccf37e08 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 21 Mar 2018 17:27:47 +0000 Subject: [PATCH] Throw USERNAME_INVALID errors --- src/danog/MadelineProto/MTProtoTools/PeerHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index b9913ce1d..c24ddf3b4 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -750,7 +750,7 @@ trait PeerHandler $res = $this->method_call('contacts.resolveUsername', ['username' => str_replace('@', '', $username)], ['datacenter' => $this->datacenter->curdc]); } catch (\danog\MadelineProto\RPCErrorException $e) { \danog\MadelineProto\Logger::log('Username resolution failed with error '.$e->getMessage(), \danog\MadelineProto\Logger::ERROR); - if (strpos($e->rpc, 'FLOOD_WAIT_') === 0 || $e->rpc === 'AUTH_KEY_UNREGISTERED') { + if (strpos($e->rpc, 'FLOOD_WAIT_') === 0 || $e->rpc === 'AUTH_KEY_UNREGISTERED' || $e->rpc === 'USERNAME_INVALID') { throw $e; } return false;