Do not allow to edit temporary notification by non-temporary.
GitOrigin-RevId: d4a6f577d70f80826f22169c3d6a07cf476bd0bf
This commit is contained in:
parent
2ec992b106
commit
e3b9772cd2
|
@ -1622,7 +1622,8 @@ void NotificationManager::edit_notification(NotificationGroupId group_id, Notifi
|
||||||
for (size_t i = 0; i < group.notifications.size(); i++) {
|
for (size_t i = 0; i < group.notifications.size(); i++) {
|
||||||
auto ¬ification = group.notifications[i];
|
auto ¬ification = group.notifications[i];
|
||||||
if (notification.notification_id == notification_id) {
|
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 "
|
LOG(ERROR) << "Ignore edit of " << notification_id << " with " << *type << ", because previous type is "
|
||||||
<< *notification.type;
|
<< *notification.type;
|
||||||
return;
|
return;
|
||||||
|
@ -1639,7 +1640,8 @@ void NotificationManager::edit_notification(NotificationGroupId group_id, Notifi
|
||||||
}
|
}
|
||||||
for (auto ¬ification : group.pending_notifications) {
|
for (auto ¬ification : group.pending_notifications) {
|
||||||
if (notification.notification_id == notification_id) {
|
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 "
|
LOG(ERROR) << "Ignore edit of " << notification_id << " with " << *type << ", because previous type is "
|
||||||
<< *notification.type;
|
<< *notification.type;
|
||||||
return;
|
return;
|
||||||
|
|
Reference in New Issue
Block a user