diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index bb10f38d..ee66c3e0 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -15,6 +15,6 @@ namespace danog\MadelineProto; /** * Manages encryption and message frames. */ -class MTProto extends Tools { - -} \ No newline at end of file +class MTProto extends Tools +{ +} diff --git a/src/danog/MadelineProto/Session.php b/src/danog/MadelineProto/Session.php index 94f4c943..1b0c33dc 100644 --- a/src/danog/MadelineProto/Session.php +++ b/src/danog/MadelineProto/Session.php @@ -176,6 +176,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB $in = $content_related ? 1 : 0; $value = $this->seq_no; $this->seq_no += $in; + return ($value * 2) + $in; } @@ -276,7 +277,9 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB foreach (range(1, $this->settings['max_tries']['query']) as $i) { try { $this->send_message($this->tl->serialize_method($method, $args), $this->tl->content_related($method)); - if ($opts["requires_answer"]) $server_answer = $this->recv_message(); + if ($opts['requires_answer']) { + $server_answer = $this->recv_message(); + } } catch (Exception $e) { $this->log->log('An error occurred while calling method '.$method.': '.$e->getMessage().' in '.$e->getFile().':'.$e->getLine().'. Recreating connection and retrying to call method...'); unset($this->sock);