From 869a33541ffdc229de4b1e4c440eabfbc444b807 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 3 Dec 2018 00:55:35 +0300 Subject: [PATCH] Minor fixes. GitOrigin-RevId: a19b9f62c992d68f4fc11eaf2d73d56a320661f3 --- td/telegram/MessagesManager.cpp | 4 ++-- td/telegram/NotificationManager.cpp | 6 +++--- td/telegram/NotificationManager.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 67c08d70f..a6acad906 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 4f1e76a96..d99184211 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 ad8f186a7..396d5bc78 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;