From f0a8af3b2df4d3dc2dcbe858b1545dc2c2fd063a Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 24 Mar 2020 01:49:04 +0300 Subject: [PATCH] Ignore notifications about messages, which can't be added to the dialog. GitOrigin-RevId: 6e5780e843760b4ff39aee751249455b9d926b01 --- td/telegram/MessagesManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 8b3c07480..99934d770 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -21483,6 +21483,15 @@ Result MessagesManager::get_messag if (message_id <= d->last_read_inbox_message_id) { return Status::Error("Ignore notification about read message"); } + if (message_id <= d->last_clear_history_message_id) { + return Status::Error("Ignore notification about message from cleared chat history"); + } + if (d->deleted_message_ids.count(message_id)) { + return Status::Error("Ignore notification about deleted message"); + } + if (message_id <= d->max_unavailable_message_id) { + return Status::Error("Ignore notification about unavailable message"); + } } if (random_id != 0) { CHECK(dialog_id.get_type() == DialogType::SecretChat);