Fix calls to load_message_notifications_from_database.

GitOrigin-RevId: c65aa3ce8a14e53d3253fcd44d8a989cb77a1899
This commit is contained in:
levlam 2019-04-03 01:50:40 +03:00
parent 1e0ddfa093
commit 62f335d3ae

View File

@ -1831,7 +1831,7 @@ void NotificationManager::remove_notification(NotificationGroupId group_id, Noti
added_notifications.pop_back();
}
}
if (added_notifications.empty()) {
if (added_notifications.empty() && max_notification_group_size_ > group_it->second.notifications.size()) {
load_message_notifications_from_database(group_it->first, group_it->second, keep_notification_group_size_);
}
}
@ -2069,7 +2069,8 @@ void NotificationManager::remove_temporary_notifications(NotificationGroupId gro
added_notifications.pop_back();
}
}
if (added_notification_count < removed_notification_ids.size()) {
if (added_notification_count < removed_notification_ids.size() &&
max_notification_group_size_ > group.notifications.size()) {
load_message_notifications_from_database(group_it->first, group, keep_notification_group_size_);
}
std::reverse(added_notifications.begin(), added_notifications.end());