From 8116952371fc9d6c897b73b86f43b8b7016beb59 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 21 Aug 2023 22:21:06 +0300 Subject: [PATCH] Make NotificationGroupInfo.last_notification_date_ private. --- td/telegram/MessagesManager.cpp | 11 ++--------- td/telegram/NotificationGroupInfo.h | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 2a1f8a439..1743801fc 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -29130,15 +29130,8 @@ MessagesManager::MessageNotificationGroup MessagesManager::get_message_notificat last_notification_date = result.notifications[0].date; last_notification_id = result.notifications[0].notification_id; } - if (last_notification_date != group_info.last_notification_date_ || - last_notification_id != group_info.last_notification_id_) { - LOG(ERROR) << "Fix last notification date in " << d->dialog_id << " from " << group_info.last_notification_date_ - << " to " << last_notification_date << " and last notification identifier from " - << group_info.last_notification_id_ << " to " << last_notification_id << " in " << group_id - << " of type " << result.type; - set_dialog_last_notification(d->dialog_id, group_info, last_notification_date, last_notification_id, - "get_message_notification_group_force"); - } + set_dialog_last_notification(d->dialog_id, group_info, last_notification_date, last_notification_id, + "get_message_notification_group_force"); std::reverse(result.notifications.begin(), result.notifications.end()); diff --git a/td/telegram/NotificationGroupInfo.h b/td/telegram/NotificationGroupInfo.h index 81163da9a..9650e0a0e 100644 --- a/td/telegram/NotificationGroupInfo.h +++ b/td/telegram/NotificationGroupInfo.h @@ -15,6 +15,7 @@ namespace td { class NotificationGroupInfo { + int32 last_notification_date_ = 0; // date of the last notification in the group NotificationId max_removed_notification_id_; // notification identifier, up to which all notifications are removed MessageId max_removed_message_id_; // message identifier, up to which all notifications are removed bool is_key_changed_ = false; // true, if the group needs to be saved to database @@ -24,8 +25,7 @@ class NotificationGroupInfo { public: NotificationGroupId group_id_; - int32 last_notification_date_ = 0; // date of last notification in the group - NotificationId last_notification_id_; // identifier of last notification in the group + NotificationId last_notification_id_; // identifier of the last notification in the group NotificationGroupInfo() = default;