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 {
|
} else {
|
||||||
remove_added_notifications_from_pending_updates(
|
remove_added_notifications_from_pending_updates(
|
||||||
group_id, [max_object_id](const td_api::object_ptr<td_api::notification> ¬ification) {
|
group_id, [max_object_id](const td_api::object_ptr<td_api::notification> ¬ification) {
|
||||||
return notification->type_->get_id() == td_api::notificationTypeNewMessage::ID &&
|
const auto *type = notification->type_.get();
|
||||||
static_cast<const td_api::notificationTypeNewMessage *>(notification->type_.get())->message_->id_ <=
|
switch (type->get_id()) {
|
||||||
|
case td_api::notificationTypeNewMessage::ID:
|
||||||
|
return static_cast<const td_api::notificationTypeNewMessage *>(type)->message_->id_ <=
|
||||||
max_object_id.get();
|
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,10 +2243,16 @@ void NotificationManager::remove_temporary_notifications(NotificationGroupId gro
|
|||||||
on_notifications_removed(std::move(group_it), std::move(added_notifications), std::move(removed_notification_ids),
|
on_notifications_removed(std::move(group_it), std::move(added_notifications), std::move(removed_notification_ids),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
remove_added_notifications_from_pending_updates(
|
remove_added_notifications_from_pending_updates(group_id,
|
||||||
group_id, [](const td_api::object_ptr<td_api::notification> ¬ification) {
|
[](const td_api::object_ptr<td_api::notification> ¬ification) {
|
||||||
return notification->get_id() == td_api::notificationTypeNewPushMessage::ID;
|
const auto *type = notification->type_.get();
|
||||||
});
|
switch (type->get_id()) {
|
||||||
|
case td_api::notificationTypeNewPushMessage::ID:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 NotificationManager::get_temporary_notification_total_count(const NotificationGroup &group) {
|
int32 NotificationManager::get_temporary_notification_total_count(const NotificationGroup &group) {
|
||||||
|
Loading…
Reference in New Issue
Block a user