From 1b57f113aae8cd124045ce83d191e0dfc12fd5fa Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 24 Mar 2017 21:13:12 +0100 Subject: [PATCH] Bugfixes, disabled incoming seqno check for the moment --- src/danog/MadelineProto/MTProtoTools/ResponseHandler.php | 3 ++- src/danog/MadelineProto/MTProtoTools/SeqNoHandler.php | 2 +- src/danog/MadelineProto/Wrappers/Login.php | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php index ed1aaee1..e84149ef 100644 --- a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php @@ -279,8 +279,9 @@ trait ResponseHandler } $only_updates = ($only_updates || $first) && $last_was_updates; $first = false; +//var_dump($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['_']); if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['seq_no']) && ($seq_no = $this->generate_in_seq_no($datacenter, $this->content_related($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['_']))) !== $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['seq_no']) { - throw new \danog\MadelineProto\SecurityException('Seqno mismatch (should be '.$seq_no.', is '.$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['seq_no']); + //throw new \danog\MadelineProto\SecurityException('Seqno mismatch (should be '.$seq_no.', is '.$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['seq_no']); } if ($unset) { unset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]); diff --git a/src/danog/MadelineProto/MTProtoTools/SeqNoHandler.php b/src/danog/MadelineProto/MTProtoTools/SeqNoHandler.php index e5eef520..3f3eadb2 100644 --- a/src/danog/MadelineProto/MTProtoTools/SeqNoHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/SeqNoHandler.php @@ -39,7 +39,7 @@ trait SeqNoHandler $method, [ 'rpc_result', - 'rpc_error', +// 'rpc_error', 'rpc_drop_answer', 'rpc_answer_unknown', 'rpc_answer_dropped_running', diff --git a/src/danog/MadelineProto/Wrappers/Login.php b/src/danog/MadelineProto/Wrappers/Login.php index d9babe1b..262782c1 100644 --- a/src/danog/MadelineProto/Wrappers/Login.php +++ b/src/danog/MadelineProto/Wrappers/Login.php @@ -48,7 +48,7 @@ trait Login ], ['datacenter' => $this->API->datacenter->curdc] ); $this->API->authorized = true; - $this->API->sync_authorization($this->API->datacenter->cur_dc); + $this->API->sync_authorization($this->API->datacenter->curdc); $this->API->updates = []; $this->API->updates_key = 0; $this->API->get_updates_state(); @@ -128,7 +128,7 @@ trait Login } $this->API->authorization = $authorization; $this->API->authorized = true; - $this->API->sync_authorization($this->API->datacenter->cur_dc); + $this->API->sync_authorization($this->API->datacenter->curdc); $this->API->get_updates_state(); $this->API->should_serialize = true; @@ -155,7 +155,7 @@ trait Login ], ['datacenter' => $this->API->datacenter->curdc] ); $this->API->authorized = true; - $this->API->sync_authorization($this->API->datacenter->cur_dc); + $this->API->sync_authorization($this->API->datacenter->curdc); $this->API->get_updates_state(); $this->API->should_serialize = true; @@ -178,7 +178,7 @@ trait Login ], ['datacenter' => $this->API->datacenter->curdc] ); $this->API->authorized = true; - $this->API->sync_authorization($this->API->datacenter->cur_dc); + $this->API->sync_authorization($this->API->datacenter->curdc); $this->API->get_updates_state(); $this->API->should_serialize = true; \danog\MadelineProto\Logger::log(['Logged in successfully!'], \danog\MadelineProto\Logger::NOTICE);