diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2013-10-28 20:06:18 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2013-10-28 20:06:18 -0400 |
commit | 57040ea70e21ea5cfaedfd8a3506362a03562552 (patch) | |
tree | eb9dc090ab72bea2353de8a940ccdc7ab69d830e /indra/newview/llpersistentnotificationstorage.cpp | |
parent | 8881b47d22a7cd17824e8162e0658af71bbe3dea (diff) | |
parent | d5877bc365292358eb4c9b8d14d1c8a1237ca5bd (diff) |
Automated merge with http://bitbucket.org/nat_linden/viewer-maint-3331
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; } |