summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index da811535e5..32b4afcfef 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -133,10 +133,10 @@ void process_dnd_im(const LLSD& notification)
LLFloaterIMContainer* container_floater =
LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
if (container_floater && !(container_floater->isFrontmost()))
- {
+ {
container_floater->openFloater();
container_floater->setFrontmost(TRUE);
- }
+ }
}
@@ -254,13 +254,22 @@ void on_new_message(const LLSD& msg)
{
if (conversation_floater_not_focused)
{
- if(session_floater_not_focused)
+ if(session_floater_not_focused && !gAgent.isDoNotDisturb())
{
//User is not focused on conversation containing the message
gToolBarView->flashCommand(LLCommandId("chat"), true);
}
im_box->flashConversationItemWidget(session_id, true);
+
+ //If a DND message, allow notification to be stored so upon DND exit
+ //useMostItrusiveIMNotification will be called to notify user a message exists
+ if(session_id.notNull()
+ && participant_id.notNull()
+ && gAgent.isDoNotDisturb())
+ {
+ LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
+ }
}
}
@@ -272,9 +281,21 @@ void on_new_message(const LLSD& msg)
//Flash line item
im_box->flashConversationItemWidget(session_id, true);
+ if(!gAgent.isDoNotDisturb())
+ {
//Surface conversations floater
LLFloaterReg::showInstance("im_container");
}
+
+ //If in DND mode, allow notification to be stored so upon DND exit
+ //useMostItrusiveIMNotification will be called to notify user a message exists
+ if(session_id.notNull()
+ && participant_id.notNull()
+ && gAgent.isDoNotDisturb())
+ {
+ LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
+ }
+}
}
}