diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index ed98ff4fa..5500441d7 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -1622,6 +1622,12 @@ void NotificationManager::edit_notification(NotificationGroupId group_id, Notifi for (size_t i = 0; i < group.notifications.size(); i++) { auto ¬ification = group.notifications[i]; if (notification.notification_id == notification_id) { + if (notification.type->get_message_id() != type->get_message_id()) { + LOG(ERROR) << "Ignore edit of " << notification_id << " with " << *type << ", because previous type is " + << *notification.type; + return; + } + notification.type = std::move(type); if (i + max_notification_group_size_ >= group.notifications.size() && !(get_last_updated_group_key() < group_it->first)) { @@ -1633,6 +1639,12 @@ void NotificationManager::edit_notification(NotificationGroupId group_id, Notifi } for (auto ¬ification : group.pending_notifications) { if (notification.notification_id == notification_id) { + if (notification.type->get_message_id() != type->get_message_id()) { + LOG(ERROR) << "Ignore edit of " << notification_id << " with " << *type << ", because previous type is " + << *notification.type; + return; + } + notification.type = std::move(type); return; }