Stability improvements

This commit is contained in:
Daniil Gentili 2018-03-11 15:16:00 +00:00
parent 5a6e60eada
commit 8c4b65762f
2 changed files with 5 additions and 1 deletions

View File

@ -219,7 +219,7 @@ trait CallHandler
} catch (\danog\MadelineProto\Exception $e) {
$last_error = $e->getMessage().' in '.basename($e->getFile(), '.php').' on line '.$e->getLine();
if (strpos($e->getMessage(), 'Received request to switch to DC ') === 0) {
if ($this->authorized_dc === -1 && $method === 'users.getUsers' && $args = ['id' => [['_' => 'inputUserSelf']]]) {
if ($this->authorized_dc === -1 && ($method === 'users.getUsers' && $args = ['id' => [['_' => 'inputUserSelf']]]) || $method === 'auth.exportAuthorization') {
$this->authorized_dc = $this->datacenter->curdc;
}
$last_recv = $this->datacenter->sockets[$aargs['datacenter']]->last_recv;

View File

@ -219,6 +219,8 @@ trait ResponseHandler
if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['answer_msg_id']])) {
$this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_id']]['response'] = $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['answer_msg_id'];
unset($this->datacenter->sockets[$datacenter]->new_outgoing[$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['msg_id']]);
} else {
$this->object_call("msg_resend_req", ['msg_ids' => [$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['answer_msg_id']]], ['datacenter' => $datacenter]);
}
}
case 'msg_new_detailed_info':
@ -226,6 +228,8 @@ trait ResponseHandler
$only_updates = false;
if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['answer_msg_id']])) {
$this->ack_incoming_message_id($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['answer_msg_id'], $datacenter);
} else {
$this->object_call("msg_resend_req", ['msg_ids' => [$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['answer_msg_id']]], ['datacenter' => $datacenter]);
}
unset($this->datacenter->sockets[$datacenter]->new_incoming[$current_msg_id]);
break;