Minor fixes.

GitOrigin-RevId: a19b9f62c992d68f4fc11eaf2d73d56a320661f3
This commit is contained in:
levlam 2018-12-03 00:55:35 +03:00
parent d1384cf9e4
commit 869a33541f
3 changed files with 6 additions and 6 deletions

View File

@ -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<int32>(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);
}
}

View File

@ -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;

View File

@ -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;