diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2014-04-03 18:56:46 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2014-04-03 18:56:46 -0400 |
commit | d7481cd07c3e0b5eed54ff6a3539406d09ed0669 (patch) | |
tree | 7e0d2a2a9733784f16518b977423deb225021651 /indra/newview/llpersistentnotificationstorage.cpp | |
parent | 076761a03d7cb8b53e6e3d4f2120091eabeba37a (diff) | |
parent | 31a3a3da5db077c4d9b8fe06a18de98c822db6ab (diff) |
Merge. Refresh from viewer-release after 3.7.4 release.
Diffstat (limited to 'indra/newview/llpersistentnotificationstorage.cpp')
-rwxr-xr-x | indra/newview/llpersistentnotificationstorage.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 076c3e0235..4f7d071d66 100755 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -77,6 +77,14 @@ void LLPersistentNotificationStorage::saveNotifications() } data.append(notification->asLLSD(true)); + if (data.size() >= gSavedSettings.getS32("MaxPersistentNotifications")) + { + llwarns << "Too many persistent notifications." + << " Saved " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << history_channel->size() + << " persistent notifications." << llendl; + break; + } + } writeNotifications(output); @@ -97,7 +105,6 @@ void LLPersistentNotificationStorage::loadNotifications() } mLoaded = true; - LLSD input; if (!readNotifications(input) ||input.isUndefined()) { @@ -115,9 +122,9 @@ void LLPersistentNotificationStorage::loadNotifications() findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); LLNotifications& instance = LLNotifications::instance(); - - for (LLSD::array_const_iterator notification_it = data.beginArray(); - notification_it != data.endArray(); + S32 processed_notifications = 0; + for (LLSD::reverse_array_iterator notification_it = data.rbeginArray(); + notification_it != data.rendArray(); ++notification_it) { LLSD notification_params = *notification_it; @@ -136,8 +143,16 @@ void LLPersistentNotificationStorage::loadNotifications() // hide saved toasts so they don't confuse the user notification_channel->hideToast(notification->getID()); } + ++processed_notifications; + if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications")) + { + llwarns << "Too many persistent notifications." + << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << llendl; + break; } - + } + LLNotifications::instance().getChannel("Persistent")-> + connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); LL_INFOS("LLPersistentNotificationStorage") << "finished loading notifications" << LL_ENDL; } |