diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-01-11 18:20:29 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-01-11 18:20:29 -0800 |
commit | 69497e645bbefe85d83e85bb353e5fb719263877 (patch) | |
tree | 8ea5f431bd5142d222dbc2ae3204f86d91ad6b95 /indra/newview/llimview.cpp | |
parent | 16082462a4d355509338ed28e396c8c81a20712a (diff) |
CHUI-668: Not fully complete but as of this commit, have functionality to use the user's most intrusive chat notification upon exiting from DND mode with IM's. Also if in DND mode, clicking on a conversation line item or floater, will flush the DND notifications system of storing that conversation. This way upon existing DND mode already responded conversations won't be notified to the user.
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 067f0d1993..e513d2e6d1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -52,6 +52,7 @@ #include "llchat.h" #include "llfloaterimsession.h" #include "llfloaterimcontainer.h" +#include "llfloaterpreference.h" #include "llgroupiconctrl.h" #include "llmd5.h" #include "llmutelist.h" @@ -128,11 +129,46 @@ void process_dnd_im(const LLSD& notification) false, false); //will need slight refactor to retrieve whether offline message or not (assume online for now) } - - //Flash toolbar button for now, eventually the user's preference will be taken into account - gToolBarView->flashCommand(LLCommandId("chat"), true); } +void useMostItrusiveIMNotification() +{ + LLFloaterPreference * instance = LLFloaterReg::getTypedInstance<LLFloaterPreference>("preferences"); + if (instance) + { + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + + //conv. floater is closed + bool conversation_floater_is_closed = + !( im_box + && im_box->isInVisibleChain() + && !im_box->isMinimized()); + + //conversation floater not focused (visible or not) + bool conversation_floater_not_focused = + conversation_floater_is_closed || !im_box->hasFocus(); + + switch(instance->getHighestNotificationIndex()) + { + //Highest priority to lowest (cases correspond to options in drop down box inside Preferences->Chat) + + //open conversation floater + case 0: + LLFloaterReg::showInstance("im_container"); + break; + //pop up message + case 1: + //flash toolbar button + case 2: + if(conversation_floater_not_focused) + { + gToolBarView->flashCommand(LLCommandId("chat"), true); + } + break; + } + } + +} static void on_avatar_name_cache_toast(const LLUUID& agent_id, const LLAvatarName& av_name, |