diff --git a/magna.php b/magna.php index 14eca4c7..e43f9681 100755 --- a/magna.php +++ b/magna.php @@ -37,7 +37,6 @@ if (getenv('TEST_SECRET_CHAT') == '') { echo 'Loading settings...'.PHP_EOL; $settings = json_decode(getenv('MTPROTO_SETTINGS'), true) ?: []; -var_dump($settings); if ($MadelineProto === false) { echo 'Loading MadelineProto...'.PHP_EOL; $MadelineProto = new \danog\MadelineProto\API($settings); diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index 2d4945d0..b9373b24 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -575,7 +575,7 @@ trait UpdateHandler $update['message']['out'] = true; } \danog\MadelineProto\Logger::log(['Saving an update of type '.$update['_'].'...'], \danog\MadelineProto\Logger::VERBOSE); - if (isset($this->settings['pwr']['strict']) && $this->settings['pwr']['strict']) { + if (isset($this->settings['pwr']['strict']) && $this->settings['pwr']['strict'] && isset($this->settings['pwr']['update_handler'])) { $this->pwr_update_handler($update); } else { in_array($this->settings['updates']['callback'], [['danog\MadelineProto\API', 'get_updates_update_handler'], 'get_updates_update_handler']) ? $this->get_updates_update_handler($update) : $this->settings['updates']['callback']($update); diff --git a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php index f78ba614..49d98744 100644 --- a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php +++ b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php @@ -89,7 +89,7 @@ trait AuthKeyHandler } if ($e->rpc === 'CALL_ALREADY_DECLINED') { \danog\MadelineProto\Logger::log(['Call '.$call['id'].' already declined']); - $this->discard_cal($call['id']); + $this->discard_call($call['id']); //$this->calls[$call['id']]->discard(); return false; @@ -263,7 +263,7 @@ trait AuthKeyHandler try { $res = $this->method_call('phone.discardCall', ['peer' => $call, 'duration' => time() - $this->calls[$call['id']]->whenCreated(), 'connection_id' => $this->calls[$call['id']]->getPreferredRelayID(), 'reason' => $reason], ['datacenter' => $this->datacenter->curdc]); } catch (\danog\MadelineProto\RPCErrorException $e) { - if ($e->rpc !== 'CALL_ALREADY_DECLINED') { + if (!in_array($e->rpc, ['CALL_ALREADY_DECLINED', 'CALL_ALREADY_ACCEPTED'])) { throw $e; } }