From db6ee920fceffc451960d45683f73661165bb86e Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 16 Aug 2017 09:58:38 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/danog/MadelineProto/MTProtoTools/UpdateHandler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index 13879e8a..b1615ed4 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -127,8 +127,6 @@ trait UpdateHandler } } - - public function check_msg_id($message) { $peer_id = $this->get_info($message['to_id'])['bot_api_id']; @@ -136,12 +134,13 @@ trait UpdateHandler if (!isset($this->msg_ids[$peer_id]) || $message_id > $this->msg_ids[$peer_id]) { $this->msg_ids[$peer_id] = $message_id; + return true; } + return false; } - public function get_channel_difference($channel) { if (!$this->settings['updates']['handle_updates']) { @@ -400,6 +399,7 @@ trait UpdateHandler if (isset($update['message']['id'], $update['message']['to_id'])) { if (!$this->check_msg_id($update['message'])) { \danog\MadelineProto\Logger::log(['Duplicate update by message id, channel id: '.$channel_id], \danog\MadelineProto\Logger::ERROR); + return false; } }