summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-12-07 14:44:15 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2012-12-07 14:44:15 -0800
commit0037b1e2c75d49481aee6fffd24395a79fbf6699 (patch)
treebdf400a99611a76a58bc41b18f3f0426c4fc3145 /indra/newview/llimview.cpp
parentdd030f1b750c230d02515027d69ba79f0084a221 (diff)
CHUI-579: Post code review. Renamed variables to make easier to read.
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp43
1 files changed, 21 insertions, 22 deletions
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");