Bugfixes, disabled incoming seqno check for the moment

This commit is contained in:
Daniil Gentili 2017-03-24 21:13:12 +01:00
parent c235afb30f
commit 1b57f113aa
3 changed files with 7 additions and 6 deletions

View File

@ -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]);

View File

@ -39,7 +39,7 @@ trait SeqNoHandler
$method,
[
'rpc_result',
'rpc_error',
// 'rpc_error',
'rpc_drop_answer',
'rpc_answer_unknown',
'rpc_answer_dropped_running',

View File

@ -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);