From cb7a07f2b0c9538eca20edf11939778409cf40fd Mon Sep 17 00:00:00 2001 From: danogentili Date: Mon, 19 Dec 2016 21:07:11 +0300 Subject: [PATCH] Now an exception won't be thrown if the ack methods can't find the message id. --- src/danog/MadelineProto/MTProtoTools/AckHandler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/AckHandler.php b/src/danog/MadelineProto/MTProtoTools/AckHandler.php index 25d431ed..e6843d73 100644 --- a/src/danog/MadelineProto/MTProtoTools/AckHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/AckHandler.php @@ -21,7 +21,7 @@ trait AckHandler { // The server acknowledges that it received my message if (!isset($this->datacenter->outgoing_messages[$message_id])) { - \danog\MadelineProto\Logger::log("Couldn't find message id ".$message_id.' in the array of outgoing messages. Maybe try to increase its size?'); + \danog\MadelineProto\Logger::log("WARNING: Couldn't find message id ".$message_id.' in the array of outgoing messages. Maybe try to increase its size?'); return false; } @@ -33,7 +33,8 @@ trait AckHandler { // I let the server know that I received its message if (!isset($this->datacenter->incoming_messages[$message_id])) { - throw new \danog\MadelineProto\Exception("Couldn't find message id ".$message_id.' in the array of incoming message ids. Maybe try to increase its size?'); + \danog\MadelineProto\Logger::log("WARNING: Couldn't find message id ".$message_id.' in the array of outgoing messages. Maybe try to increase its size?'); + //throw new \danog\MadelineProto\Exception("Couldn't find message id ".$message_id.' in the array of incoming message ids. Maybe try to increase its size?'); } if ($this->datacenter->temp_auth_key['id'] === null || $this->datacenter->temp_auth_key['id'] == $this->string2bin('\x00\x00\x00\x00\x00\x00\x00\x00') || (isset($this->datacenter->incoming_messages[$message_id]['ack']) && $this->datacenter->incoming_messages[$message_id]['ack'])) { return;