diff options
| author | Oz Linden <oz@lindenlab.com> | 2013-11-11 16:19:35 -0500 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2013-11-11 16:19:35 -0500 |
| commit | 3c2b90514d1390594149f35a88f2e5d27d173d58 (patch) | |
| tree | 844fbaf5f5c285876601e098c2e109c35d542f07 /indra/newview/llpersistentnotificationstorage.cpp | |
| parent | b8f1e2a7704bdac5ef270be21918317a17f77b2a (diff) | |
| parent | ebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 (diff) | |
merge 3.6.10-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..d8fc2bee32 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; } |
