summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimnearbychathandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimnearbychathandler.cpp')
-rw-r--r--indra/newview/llfloaterimnearbychathandler.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index 7afcf288ce..9ce5e12897 100644
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -559,9 +559,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
- if(( nearby_chat->hasFocus()
- || im_box->hasFocus()
- || ( chat_msg.mSourceType == CHAT_SOURCE_AGENT
+ if(( ( chat_msg.mSourceType == CHAT_SOURCE_AGENT
&& gSavedSettings.getBOOL("UseChatBubbles") )
|| mChannel.isDead()
|| !mChannel.get()->getShowToasts() )
@@ -606,17 +604,20 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
toast_msg = chat_msg.mText;
}
- //Don't show nearby toast, if conversation is visible but not focused
- LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(LLUUID());
- if (session_floater && session_floater->isMessagePaneExpanded()
- && session_floater->isInVisibleChain() && !session_floater->isMinimized()
- && !(session_floater->getHost() && session_floater->getHost()->isMinimized()))
+ //Don't show nearby toast, if conversation is visible and selected
+ if ((nearby_chat->hasFocus()) ||
+ ((im_box->getSelectedSession().isNull() &&
+ ((LLFloater::isVisible(im_box) && !im_box->isMinimized() && im_box->isFrontmost())
+ || (LLFloater::isVisible(nearby_chat) && !nearby_chat->isMinimized() && nearby_chat->isFrontmost())))))
{
- return;
+ if(nearby_chat->isMessagePaneExpanded())
+ {
+ return;
+ }
}
//Will show toast when chat preference is set
- if((gSavedSettings.getString("NotificationNearbyChatOptions") == "toast") || !session_floater->isMessagePaneExpanded())
+ if((gSavedSettings.getString("NotificationNearbyChatOptions") == "toast") || !nearby_chat->isMessagePaneExpanded())
{
// Add a nearby chat toast.
LLUUID id;