summaryrefslogtreecommitdiff
path: root/indra/newview/llpersistentnotificationstorage.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-11-11 15:50:01 -0800
committerGraham Linden <graham@lindenlab.com>2013-11-11 15:50:01 -0800
commit10705b43600d31b31d903ed1d4e3aba0bd4e2963 (patch)
treedf43426032ec82dc34f9019a063a4cdfa00be1da /indra/newview/llpersistentnotificationstorage.cpp
parent66b6bffca92261d418f9888be4c3542554ddb4af (diff)
parentebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 (diff)
Merge 3.6.11 for RC-ability
Diffstat (limited to 'indra/newview/llpersistentnotificationstorage.cpp')
-rwxr-xr-xindra/newview/llpersistentnotificationstorage.cpp25
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;
}