Ignore notifications about messages, which can't be added to the dialog.

GitOrigin-RevId: 6e5780e843760b4ff39aee751249455b9d926b01
This commit is contained in:
levlam 2020-03-24 01:49:04 +03:00
parent 1310aa7f2c
commit f0a8af3b2d

View File

@ -21483,6 +21483,15 @@ Result<MessagesManager::MessagePushNotificationInfo> 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);