Do not check qts with updates fetched via getDifference

This commit is contained in:
Daniil Gentili 2019-06-21 16:49:22 +02:00
parent eba925759a
commit 100d0f8c76

View File

@ -229,6 +229,7 @@ trait UpdateHandler
} }
} }
if ($update['_'] === 'updateNewEncryptedMessage' && !isset($update['message']['decrypted_message'])) { if ($update['_'] === 'updateNewEncryptedMessage' && !isset($update['message']['decrypted_message'])) {
if (isset($update['qts'])) {
$cur_state = yield $this->load_update_state_async(); $cur_state = yield $this->load_update_state_async();
if ($cur_state->qts() === -1) { if ($cur_state->qts() === -1) {
$cur_state->qts($update['qts']); $cur_state->qts($update['qts']);
@ -246,6 +247,7 @@ trait UpdateHandler
} }
$this->logger->logger('Applying qts: '.$update['qts'].' over current qts '.$cur_state->qts().', chat id: '.$update['message']['chat_id'], \danog\MadelineProto\Logger::VERBOSE); $this->logger->logger('Applying qts: '.$update['qts'].' over current qts '.$cur_state->qts().', chat id: '.$update['message']['chat_id'], \danog\MadelineProto\Logger::VERBOSE);
yield $this->method_call_async_read('messages.receivedQueue', ['max_qts' => $cur_state->qts($update['qts'])], ['datacenter' => $this->settings['connection_settings']['default_dc']]); yield $this->method_call_async_read('messages.receivedQueue', ['max_qts' => $cur_state->qts($update['qts'])], ['datacenter' => $this->settings['connection_settings']['default_dc']]);
}
yield $this->handle_encrypted_update_async($update); yield $this->handle_encrypted_update_async($update);
return; return;