summaryrefslogtreecommitdiff
path: root/indra/newview/lldonotdisturbnotificationstorage.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-01-25 17:47:36 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-01-25 17:47:36 -0800
commitc418d616276ce16d910c6e5528f6aa058803e1c7 (patch)
treeaf7c6d992eb34c37d58ffb55561e5a62893617c3 /indra/newview/lldonotdisturbnotificationstorage.cpp
parentdaa9db305a5ae2c0c5b0c2425d6482de6dee7b2c (diff)
CHUI-667 Upon exit from DND mode, a maximum of one sound should be played. Solution. Added a deferred sound class which will have sound id's added to it and upon unmuting the deferred sounds will be played.
Diffstat (limited to 'indra/newview/lldonotdisturbnotificationstorage.cpp')
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp
index 15c42e8285..6e39d049a5 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.cpp
+++ b/indra/newview/lldonotdisturbnotificationstorage.cpp
@@ -146,6 +146,7 @@ void LLDoNotDisturbNotificationStorage::loadNotifications()
LLNotifications& instance = LLNotifications::instance();
bool imToastExists = false;
+ bool offerExists = false;
for (LLSD::array_const_iterator notification_it = data.beginArray();
notification_it != data.endArray();
@@ -160,6 +161,10 @@ void LLDoNotDisturbNotificationStorage::loadNotifications()
{
imToastExists = true;
}
+ else if(notificationName == offerName)
+ {
+ offerExists = true;
+ }
//New notification needs to be added
notification = (LLNotificationPtr) new LLNotification(notification_params.with("is_dnd", true));
@@ -183,6 +188,11 @@ void LLDoNotDisturbNotificationStorage::loadNotifications()
LLFloaterReg::showInstance("im_container");
}
+ if(imToastExists || offerExists)
+ {
+ make_ui_sound_deferred("UISndNewIncomingIMSession");
+ }
+
//writes out empty .xml file (since LLCommunicationChannel::mHistory is empty)
saveNotifications();
}
@@ -196,6 +206,7 @@ void LLDoNotDisturbNotificationStorage::updateNotifications()
LLNotifications& instance = LLNotifications::instance();
bool imToastExists = false;
+ bool offerExists = false;
for (LLCommunicationChannel::history_list_t::const_iterator it = commChannel->beginHistory();
it != commChannel->endHistory();
@@ -208,6 +219,10 @@ void LLDoNotDisturbNotificationStorage::updateNotifications()
{
imToastExists = true;
}
+ else if(notificationName == offerName)
+ {
+ offerExists = true;
+ }
//Notification already exists in notification pipeline (same instance of app running)
if (notification)
@@ -222,6 +237,11 @@ void LLDoNotDisturbNotificationStorage::updateNotifications()
LLFloaterReg::showInstance("im_container");
}
+ if(imToastExists || offerExists)
+ {
+ make_ui_sound("UISndNewIncomingIMSession");
+ }
+
//When exit DND mode, write empty notifications file
if(commChannel->getHistorySize())
{