summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-03-15 17:57:48 -0700
committerMerov Linden <merov@lindenlab.com>2013-03-15 17:57:48 -0700
commite8b22d3299e5e02f3349315fcf9e0166632e06c4 (patch)
treef0ae929e3bd76de83d41d7b286dfed15947e821d /indra/newview/llimview.cpp
parent242c39f24bc38ee306f1a9b4a173fd095fdab49d (diff)
parent780fe4e37fe5df4120ef4de09e6fc69f6184e4d3 (diff)
Pull merge from lindenlab/viewer-chui
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index fbb3bd4a8e..10e214bc90 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -199,13 +199,13 @@ void on_new_message(const LLSD& msg)
// execution of the action
LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
-
- if (im_box->isFrontmost() && im_box->getSelectedSession() == session_id)
+ LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id);
+
+ if (im_box->isFrontmost() && im_box->getSelectedSession() == session_id
+ && !(session_floater->getHost() ? im_box->isMinimized() : session_floater->isMinimized()))
{
return;
}
-
- LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id);
//session floater not focused (visible or not)
bool session_floater_not_focused = session_floater && !session_floater->hasFocus();
@@ -226,17 +226,18 @@ void on_new_message(const LLSD& msg)
&& !session_floater->isMinimized()
&& !(session_floater->getHost() && session_floater->getHost()->isMinimized());
- if ("toast" == action && !session_floater_is_open)
+ bool conversation_floater_collapsed = !session_floater->isMessagePaneExpanded();
+ if (("toast" == action && !session_floater_is_open) || conversation_floater_collapsed)
{
//User is not focused on conversation containing the message
- if(session_floater_not_focused)
+ if(session_floater_not_focused || conversation_floater_collapsed)
{
if(!LLMuteList::getInstance()->isMuted(participant_id))
{
im_box->flashConversationItemWidget(session_id, true);
}
//The conversation floater isn't focused/open
- if(conversation_floater_not_focused)
+ if(conversation_floater_not_focused || conversation_floater_collapsed)
{
if(!LLMuteList::getInstance()->isMuted(participant_id)
&& !gAgent.isDoNotDisturb())
@@ -286,9 +287,22 @@ void on_new_message(const LLSD& msg)
//Surface conversations floater
LLFloaterReg::showInstance("im_container");
im_box->collapseMessagesPane(false);
- if (session_floater && session_floater->isMinimized())
+ if (session_floater)
{
- LLFloater::onClickMinimize(session_floater);
+ if (session_floater->getHost())
+ {
+ if (NULL != im_box && im_box->isMinimized())
+ {
+ LLFloater::onClickMinimize(im_box);
+ }
+ }
+ else
+ {
+ if (session_floater->isMinimized())
+ {
+ LLFloater::onClickMinimize(session_floater);
+ }
+ }
}
}
@@ -2637,7 +2651,7 @@ void LLIMMgr::addMessage(
if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly"))
{
// Evaluate if we need to skip this message when that setting is true (default is false)
- LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
+ LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(new_session_id);
skip_message = (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL); // Skip non friends...
skip_message &= !session->isGroupSessionType(); // Do not skip group chats...
skip_message &= !(other_participant_id == gAgentID); // You are your best friend... Don't skip yourself
@@ -2653,7 +2667,7 @@ void LLIMMgr::addMessage(
{
LLFloaterReg::showInstance("im_container");
LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")->
- flashConversationItemWidget(session_id, true);
+ flashConversationItemWidget(new_session_id, true);
}
}