diff options
author | maxim@mnikolenko <maxim@mnikolenko> | 2013-01-17 15:04:30 +0200 |
---|---|---|
committer | maxim@mnikolenko <maxim@mnikolenko> | 2013-01-17 15:04:30 +0200 |
commit | 05e063836abb20d487dfd4175a09413b0cea0e38 (patch) | |
tree | 13628e331344eb085d930a0217317f220dd730eb /indra/newview/llimview.cpp | |
parent | b0774ec9147ddc2c2e5e93e5a74c929c802c32af (diff) | |
parent | 2f551019921ca12f9dd94f474a4d684e04d73dd7 (diff) |
Merge
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index da811535e5..ff171fc0f8 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -128,18 +128,11 @@ void process_dnd_im(const LLSD& notification) false, false); //will need slight refactor to retrieve whether offline message or not (assume online for now) } - - // open conversation floater - LLFloaterIMContainer* container_floater = - LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); - if (container_floater && !(container_floater->isFrontmost())) - { - container_floater->openFloater(); - container_floater->setFrontmost(TRUE); - } } + + static void on_avatar_name_cache_toast(const LLUUID& agent_id, const LLAvatarName& av_name, LLSD msg) @@ -254,13 +247,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 +274,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)); + } +} } } @@ -2605,13 +2619,7 @@ void LLIMMgr::addMessage( // Open conversation floater if offline messages are present if (is_offline_msg) { - LLFloaterIMContainer* container_floater = - LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); - if (container_floater && !(container_floater->isFrontmost())) - { - container_floater->openFloater(); - container_floater->setFrontmost(TRUE); - } + LLFloaterReg::showInstance("im_container"); } } |