summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterimnearbychathandler.cpp15
-rw-r--r--indra/newview/llimview.cpp12
2 files changed, 11 insertions, 16 deletions
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index 7afcf288ce..0824b26406 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,16 @@ 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 (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;
}
//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;
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index ca04d27d11..76a314f807 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -181,9 +181,9 @@ void on_new_message(const LLSD& msg)
{
conversations_floater_status = CLOSED;
}
- else if (!im_box->isFrontmost() &&
+ else if ( !im_box->hasFocus() &&
(!session_floater || !LLFloater::isVisible(session_floater)
- || session_floater->isMinimized() || !session_floater->isFrontmost()))
+ || session_floater->isMinimized() || !session_floater->hasFocus()))
{
conversations_floater_status = NOT_ON_TOP;
}
@@ -274,7 +274,7 @@ void on_new_message(const LLSD& msg)
// 2. Flash line item
if ("openconversations" == user_preferences
- || NOT_ON_TOP == conversations_floater_status)
+ || ON_TOP == conversations_floater_status)
{
if(!LLMuteList::getInstance()->isMuted(participant_id))
{
@@ -283,7 +283,7 @@ void on_new_message(const LLSD& msg)
}
// 3. Flash FUI button
- if ("flash" == user_preferences &&
+ if (("toast" == user_preferences || "flash" == user_preferences) &&
(CLOSED == conversations_floater_status
|| NOT_ON_TOP == conversations_floater_status))
{
@@ -295,9 +295,7 @@ void on_new_message(const LLSD& msg)
}
// 4. Toast
- if (("toast" == user_preferences &&
- (CLOSED == conversations_floater_status
- || NOT_ON_TOP == conversations_floater_status))
+ if ("toast" == user_preferences
|| !session_floater->isMessagePaneExpanded())
{
//Show IM toasts (upper right toasts)