1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 14:34:39 +01:00

Trying to fix bugs

This commit is contained in:
Daniil Gentili 2017-01-14 17:43:46 +01:00
parent ead78628ed
commit 491c15e5e3

View File

@ -78,13 +78,16 @@ trait CallHandler
throw new \danog\MadelineProto\RPCErrorException($server_answer['error_message'], $server_answer['error_code']);
break;
}
/*
case 420:
$seconds = preg_replace('/[^0-9]+/', '', $server_answer['error_message']);
\danog\MadelineProto\Logger::log('Flood, waiting '.$seconds.' seconds...');
sleep($seconds);
throw new \danog\MadelineProto\Exception('Re-executing query...');
*/
if ($this->settings['pwr']['pwr']) {
$seconds = preg_replace('/[^0-9]+/', '', $server_answer['error_message']);
if (is_numeric($seconds) && $seconds < 20) {
\danog\MadelineProto\Logger::log('Flood, waiting '.$seconds.' seconds...');
sleep($seconds);
throw new \danog\MadelineProto\Exception('Re-executing query...');
}
}
default:
throw new \danog\MadelineProto\RPCErrorException($server_answer['error_message'], $server_answer['error_code']);
break;