1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 05:54:41 +01:00

Throw USERNAME_INVALID errors

This commit is contained in:
Daniil Gentili 2018-03-21 17:27:47 +00:00
parent 52231d47ee
commit 209dde1a89

View File

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