diff --git a/bot.php b/bot.php index d7c5f869..64df99ab 100755 --- a/bot.php +++ b/bot.php @@ -57,7 +57,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler } } } -$settings = ['logger' => ['logger_level' => 5]]; +$settings = ['logger' => ['logger_level' => 5], 'serialization' => ['serialization_interval' => 30, 'cleanup_before_serialization' => true]]; $MadelineProto = new \danog\MadelineProto\API('bot.madeline', $settings); $MadelineProto->async(true); diff --git a/docs b/docs index 1c91f780..8f6784ad 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 1c91f7808bc95c909b6ba8502b68b5d4fe9c9a41 +Subproject commit 8f6784adf5bca1dbab98ba1ec69ab52050633ca1 diff --git a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php index 7d3b6bab..9639a27b 100644 --- a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php +++ b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php @@ -127,7 +127,7 @@ trait AuthKeyHandler $this->check_G($params['g_b'], $dh_config['p']); $key = str_pad($params['g_b']->powMod($this->calls[$params['id']]->storage['a'], $dh_config['p'])->toBytes(), 256, chr(0), \STR_PAD_LEFT); try { - $res = yield $this->method_call_async_read('phone.confirmCall', ['key_fingerprint' => substr(sha1($key, true), -8), 'peer' => ['id' => $params['id'], 'access_hash' => $params['access_hash'], '_' => 'inputPhoneCall'], 'g_a' => $this->calls[$params['id']]->storage['g_a'], 'protocol' => ['_' => 'phoneCallProtocol', 'udp_reflector' => true, 'min_layer' => 65, 'max_layer' => \danog\MadelineProto\VoIP::getConnectionMaxLayer()]], ['datacenter' => $this->datacenter->curdc])['phone_call']; + $res = (yield $this->method_call_async_read('phone.confirmCall', ['key_fingerprint' => substr(sha1($key, true), -8), 'peer' => ['id' => $params['id'], 'access_hash' => $params['access_hash'], '_' => 'inputPhoneCall'], 'g_a' => $this->calls[$params['id']]->storage['g_a'], 'protocol' => ['_' => 'phoneCallProtocol', 'udp_reflector' => true, 'min_layer' => 65, 'max_layer' => \danog\MadelineProto\VoIP::getConnectionMaxLayer()]], ['datacenter' => $this->datacenter->curdc]))['phone_call']; } catch (\danog\MadelineProto\RPCErrorException $e) { if ($e->rpc === 'CALL_ALREADY_ACCEPTED') { $this->logger->logger(sprintf(\danog\MadelineProto\Lang::$current_lang['call_already_accepted'], $call['id']));