summaryrefslogtreecommitdiff
path: root/indra/newview/llpersistentnotificationstorage.cpp
diff options
context:
space:
mode:
authorcallum_linden <none@none>2016-05-06 13:40:29 -0700
committercallum_linden <none@none>2016-05-06 13:40:29 -0700
commitc5d6bfe8ae61e3311c260626b590586d3cde4b6e (patch)
tree4b731e4be618f6b9048bcc7e6dadf663f0baec49 /indra/newview/llpersistentnotificationstorage.cpp
parent811a0b5726ed965f9f21ace2d3ec97bb95a91311 (diff)
parent94559950a2c670990db56bd74e65d26652421b8c (diff)
Merge with viewer-release
Diffstat (limited to 'indra/newview/llpersistentnotificationstorage.cpp')
-rwxr-xr-xindra/newview/llpersistentnotificationstorage.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp
index 9e4f50b7a7..9c0222d0bc 100755
--- a/indra/newview/llpersistentnotificationstorage.cpp
+++ b/indra/newview/llpersistentnotificationstorage.cpp
@@ -123,11 +123,28 @@ void LLPersistentNotificationStorage::loadNotifications()
LLNotifications& instance = LLNotifications::instance();
S32 processed_notifications = 0;
+ std::vector<LLSD> notifications_array;
for (LLSD::reverse_array_iterator notification_it = data.rbeginArray();
notification_it != data.rendArray();
++notification_it)
{
LLSD notification_params = *notification_it;
+ notifications_array.push_back(notification_params);
+
+ ++processed_notifications;
+ if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications"))
+ {
+ LL_WARNS() << "Too many persistent notifications."
+ << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << LL_ENDL;
+ break;
+ }
+ }
+
+ for (LLSD::reverse_array_iterator notification_it = notifications_array.rbegin();
+ notification_it != notifications_array.rend();
+ ++notification_it)
+ {
+ LLSD notification_params = *notification_it;
LLNotificationPtr notification(new LLNotification(notification_params));
LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"]));
@@ -143,14 +160,8 @@ 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"))
- {
- LL_WARNS() << "Too many persistent notifications."
- << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << LL_ENDL;
- break;
- }
}
+
LLNotifications::instance().getChannel("Persistent")->
connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1));
LL_INFOS("LLPersistentNotificationStorage") << "finished loading notifications" << LL_ENDL;