Fix removal of notifications from pending updates.
This commit is contained in:
parent
432f77ae85
commit
989dc3d8a6
@ -2136,9 +2136,17 @@ void NotificationManager::remove_notification_group(NotificationGroupId group_id
|
||||
} else {
|
||||
remove_added_notifications_from_pending_updates(
|
||||
group_id, [max_object_id](const td_api::object_ptr<td_api::notification> ¬ification) {
|
||||
return notification->type_->get_id() == td_api::notificationTypeNewMessage::ID &&
|
||||
static_cast<const td_api::notificationTypeNewMessage *>(notification->type_.get())->message_->id_ <=
|
||||
const auto *type = notification->type_.get();
|
||||
switch (type->get_id()) {
|
||||
case td_api::notificationTypeNewMessage::ID:
|
||||
return static_cast<const td_api::notificationTypeNewMessage *>(type)->message_->id_ <=
|
||||
max_object_id.get();
|
||||
case td_api::notificationTypeNewPushMessage::ID:
|
||||
return static_cast<const td_api::notificationTypeNewPushMessage *>(type)->message_id_ <=
|
||||
max_object_id.get();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -2235,9 +2243,15 @@ void NotificationManager::remove_temporary_notifications(NotificationGroupId gro
|
||||
on_notifications_removed(std::move(group_it), std::move(added_notifications), std::move(removed_notification_ids),
|
||||
false);
|
||||
|
||||
remove_added_notifications_from_pending_updates(
|
||||
group_id, [](const td_api::object_ptr<td_api::notification> ¬ification) {
|
||||
return notification->get_id() == td_api::notificationTypeNewPushMessage::ID;
|
||||
remove_added_notifications_from_pending_updates(group_id,
|
||||
[](const td_api::object_ptr<td_api::notification> ¬ification) {
|
||||
const auto *type = notification->type_.get();
|
||||
switch (type->get_id()) {
|
||||
case td_api::notificationTypeNewPushMessage::ID:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user