diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 67c08d70..a6acad90 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -17623,7 +17623,7 @@ MessagesManager::MessageNotificationGroup MessagesManager::get_message_notificat result.total_count = 0; } result.notifications = get_message_notifications_from_database( - d, NotificationId::max(), td_->notification_manager_->get_max_notification_group_size()); + d, NotificationId::max(), static_cast(td_->notification_manager_->get_max_notification_group_size())); int32 last_notification_date = 0; NotificationId last_notification_id; @@ -17760,7 +17760,7 @@ void MessagesManager::do_remove_message_notification(DialogId dialog_id, Notific } auto m = on_get_message_from_database(dialog_id, d, std::move(result[0])); - if (is_message_has_active_notification(d, m)) { + if (m->notification_id == notification_id && is_message_has_active_notification(d, m)) { remove_message_notification_id(d, m, false); } } diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index 4f1e76a9..d9918421 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -244,7 +244,7 @@ int32 NotificationManager::load_message_notification_groups_from_database(int32 return result; } -int32 NotificationManager::get_max_notification_group_size() const { +size_t NotificationManager::get_max_notification_group_size() const { return max_notification_group_size_; } @@ -273,7 +273,7 @@ NotificationGroupId NotificationManager::get_next_notification_group_id() { } NotificationGroupKey NotificationManager::get_last_updated_group_key() const { - int32 left = max_notification_group_count_; + size_t left = max_notification_group_count_; auto it = groups_.begin(); while (it != groups_.end() && left > 1) { ++it; @@ -1355,7 +1355,7 @@ void NotificationManager::on_notification_group_size_max_changed() { flush_all_pending_notifications(); flush_all_pending_updates(true, "on_notification_group_size_max_changed"); - int32 left = max_notification_group_count_; + size_t left = max_notification_group_count_; for (auto it = groups_.begin(); it != groups_.end() && left > 0; ++it, left--) { auto &group_key = it->first; auto &group = it->second; diff --git a/td/telegram/NotificationManager.h b/td/telegram/NotificationManager.h index ad8f186a..396d5bc7 100644 --- a/td/telegram/NotificationManager.h +++ b/td/telegram/NotificationManager.h @@ -41,7 +41,7 @@ class NotificationManager : public Actor { NotificationManager(Td *td, ActorShared<> parent); - int32 get_max_notification_group_size() const; + size_t get_max_notification_group_size() const; NotificationId get_max_notification_id() const;