From 251adef8cecc04a5b885e150c0b225d99ccf21c9 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 8 Jan 2017 14:22:21 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/danog/MadelineProto/MTProtoTools/CallHandler.php | 4 +++- src/danog/MadelineProto/MTProtoTools/UpdateHandler.php | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index 80d94412..3706a556 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -38,7 +38,9 @@ trait CallHandler $this->recv_message(); // This method receives data from the socket, and parses stuff if (!isset($this->datacenter->outgoing_messages[$int_message_id]['response']) || !isset($this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content'])) { // Checks if I have received the response to the called method, if not continue looping - if ($this->only_updates) $res_count--; + if ($this->only_updates) { + $res_count--; + } continue; } $server_answer = $this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content']; // continue was not called, so I got a response diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index 28116e86..4fee9add 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -183,6 +183,7 @@ trait UpdateHandler case 'updateEditChannelMessage': if ($update['message']['_'] == 'messageEmpty') { \danog\MadelineProto\Logger::log('Got message empty, not saving'); + return false; } $channel_id = $update['message']['to_id']['channel_id']; @@ -205,13 +206,13 @@ trait UpdateHandler } else { $cur_state = &$this->get_channel_state($channel_id, (isset($update['pts']) ? $update['pts'] : 0) - (isset($update['pts_count']) ? $update['pts_count'] : 0)); } - + if ($cur_state['sync_loading']) { \danog\MadelineProto\Logger::log('Sync loading, not handling update'); return false; } - + switch ($update['_']) { case 'updateChannelTooLong': $this->get_channel_difference($channel_id);