From cbf9d99ec28986d64089174af36f37c7fab74877 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 31 Jul 2017 17:08:14 +0000 Subject: [PATCH] fixes --- src/danog/MadelineProto/RPCErrorException.php | 1 + src/danog/MadelineProto/VoIP/AuthKeyHandler.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/danog/MadelineProto/RPCErrorException.php b/src/danog/MadelineProto/RPCErrorException.php index 0ae6b892..068c030f 100644 --- a/src/danog/MadelineProto/RPCErrorException.php +++ b/src/danog/MadelineProto/RPCErrorException.php @@ -65,6 +65,7 @@ class RPCErrorException extends \Exception case 'PEER_ID_INVALID': $message = 'The provided peer id is invalid'; break; case 'CHAT_ID_INVALID': $message = 'The provided chat id is invalid'; break; case 'MESSAGE_DELETE_FORBIDDEN': $message = "You can't delete one of the messages you tried to delete, most likely because it is a service message."; break; + case 'CHAT_ADMIN_REQUIRED': $message = 'You must be an admin in this chat to do this'; break; case -429: $message = 'Too many requests'; break; } parent::__construct($message, $code, $previous); diff --git a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php index f990a520..793545e8 100644 --- a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php +++ b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php @@ -87,7 +87,7 @@ trait AuthKeyHandler } if ($e->rpc === 'CALL_ALREADY_DECLINED') { \danog\MadelineProto\Logger::log(['Call '.$call['id'].' already declined']); - $this->calls[$res['phone_call']['id']]->discard(); + $this->calls[$call['id']]->discard(); return false; } throw $e;