diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2012-12-07 14:44:15 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2012-12-07 14:44:15 -0800 |
commit | 0037b1e2c75d49481aee6fffd24395a79fbf6699 (patch) | |
tree | bdf400a99611a76a58bc41b18f3f0426c4fc3145 /indra/newview | |
parent | dd030f1b750c230d02515027d69ba79f0084a221 (diff) |
CHUI-579: Post code review. Renamed variables to make easier to read.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterimnearbychathandler.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 43 |
2 files changed, 25 insertions, 23 deletions
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 903c903381..f64cfd0245 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -557,7 +557,10 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, // Send event on to LLEventStream sChatWatcher->post(chat); - if( nearby_chat->isInVisibleChain() + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + + if( nearby_chat->hasFocus() + || im_box->hasFocus() || ( chat_msg.mSourceType == CHAT_SOURCE_AGENT && gSavedSettings.getBOOL("UseChatBubbles") ) || mChannel.isDead() diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6ffc3b610b..ab2f275711 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -159,10 +159,11 @@ void on_new_message(const LLSD& msg) LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); - bool sessionFloaterInActive = session_floater - && (!session_floater->isInVisibleChain()) //conversation floater not displayed - || - (session_floater->isInVisibleChain() && session_floater->hasFocus() == false); //conversation floater is displayed but doesn't have focus + //session floater not focused (visible or not) + bool sessionFloaterNotFocused = session_floater && !session_floater->hasFocus(); + + //conversation floater not focused (visible or not) + bool conversationFloaterNotFocused = im_box && !im_box->hasFocus(); if ("toast" == action) { @@ -185,43 +186,41 @@ void on_new_message(const LLSD& msg) return; } - //Show IM toasts (upper right toasts) - if(session_id.notNull()) - { - LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); - } - - //Session floater has focus, so don't need to show notification flashes - if(sessionFloaterInActive) + //User is not focused on conversation containing the message + if(sessionFloaterNotFocused) { - //Flash converstation line item anytime that conversation doesn't have focus im_box->flashConversationItemWidget(session_id, true); - //Only flash the 'Chat' FUI button when the conversation floater isn't focused (implies not front most floater) - if(!im_box->hasFocus()) + //The conversation floater isn't focused/open + if(conversationFloaterNotFocused) { gToolBarView->flashCommand(LLCommandId("chat"), true); + + //Show IM toasts (upper right toasts) + LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); } } } else if ("flash" == action) { - if(sessionFloaterInActive && !im_box->hasFocus()) + //User is not focused on conversation containing the message + if(sessionFloaterNotFocused && conversationFloaterNotFocused) { - gToolBarView->flashCommand(LLCommandId("chat"), true); // flashing of the FUI button "Chat" + gToolBarView->flashCommand(LLCommandId("chat"), true); } - else if(sessionFloaterInActive) + //conversation floater is open but a different conversation is focused + else if(sessionFloaterNotFocused) { - im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item + im_box->flashConversationItemWidget(session_id, true); } } else if("openconversations" == action) { - //Don't flash and show conversation floater when conversation already active (has focus) - if(sessionFloaterInActive) + //User is not focused on conversation containing the message + if(sessionFloaterNotFocused) { //Flash line item - im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item + im_box->flashConversationItemWidget(session_id, true); //Surface conversations floater LLFloaterReg::showInstance("im_container"); |