Save only server message IDs as group_info.max_removed_message_id, because local message IDs can be reused.

GitOrigin-RevId: 931d3c165e9ab297da14aba32b6852e49d99da2e
This commit is contained in:
levlam 2019-04-26 02:13:42 +03:00
parent 2898c8909b
commit 0ed6024d0c

View File

@ -19213,7 +19213,7 @@ void MessagesManager::remove_message_notifications(DialogId dialog_id, Notificat
if (max_message_id.get() > group_info.max_removed_message_id.get()) {
VLOG(notifications) << "Set max_removed_message_id in " << group_info.group_id << '/' << dialog_id << " to "
<< max_message_id;
group_info.max_removed_message_id = max_message_id;
group_info.max_removed_message_id = max_message_id.get_prev_server_message_id();
}
VLOG(notifications) << "Set max_removed_notification_id in " << group_info.group_id << '/' << dialog_id << " to "
@ -19543,7 +19543,7 @@ void MessagesManager::remove_all_dialog_notifications(Dialog *d, NotificationGro
<< group_info.last_notification_id << " from " << source;
group_info.max_removed_notification_id = group_info.last_notification_id;
if (d->max_notification_message_id.get() > group_info.max_removed_message_id.get()) {
group_info.max_removed_message_id = d->max_notification_message_id;
group_info.max_removed_message_id = d->max_notification_message_id.get_prev_server_message_id();
}
// remove_message_notifications will be called by NotificationManager
send_closure_later(G()->notification_manager(), &NotificationManager::remove_notification_group,