From e3b9772cd25842e6ae692965e984945ad9255273 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 17 Jun 2019 18:59:35 +0300 Subject: [PATCH] Do not allow to edit temporary notification by non-temporary. GitOrigin-RevId: d4a6f577d70f80826f22169c3d6a07cf476bd0bf --- td/telegram/NotificationManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index 5500441d7..652ece14b 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -1622,7 +1622,8 @@ 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()) { + if (notification.type->get_message_id() != type->get_message_id() || + notification.type->is_temporary() != type->is_temporary()) { LOG(ERROR) << "Ignore edit of " << notification_id << " with " << *type << ", because previous type is " << *notification.type; return; @@ -1639,7 +1640,8 @@ 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()) { + if (notification.type->get_message_id() != type->get_message_id() || + notification.type->is_temporary() != type->is_temporary()) { LOG(ERROR) << "Ignore edit of " << notification_id << " with " << *type << ", because previous type is " << *notification.type; return;