summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-03-22 10:04:35 -0400
committerOz Linden <oz@lindenlab.com>2013-03-22 10:04:35 -0400
commit87f77337ac01e16bb2cf30984d6a0113e44e2aaf (patch)
treee9fa87b4d3b872562fe3bce65c986713e3bfc04b /indra/newview/llimview.cpp
parent31ae74e9f3ac02080ccc8794457cf0b350943ddb (diff)
parentef544a22218d59c6a121d4bf88c49868a2b9a713 (diff)
merge changes for 3.5.0-beta5
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp45
1 files changed, 30 insertions, 15 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 37f5888e8c..8c862548bb 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -154,6 +154,7 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id,
args["FROM"] = av_name.getCompleteName();
args["FROM_ID"] = msg["from_id"];
args["SESSION_ID"] = msg["session_id"];
+ args["SESSION_TYPE"] = msg["session_type"];
LLNotificationsUtil::add("IMToast", args, args, boost::bind(&LLFloaterIMContainer::showConversation, LLFloaterIMContainer::getInstance(), msg["session_id"].asUUID()));
}
@@ -199,13 +200,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 +227,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())
@@ -285,10 +287,23 @@ void on_new_message(const LLSD& msg)
{
//Surface conversations floater
LLFloaterReg::showInstance("im_container");
-
- if (session_floater && session_floater->isMinimized())
+ im_box->collapseMessagesPane(false);
+ 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);
+ }
+ }
}
}
@@ -641,8 +656,7 @@ void LLIMModel::LLIMSession::loadHistory()
LLIMModel::LLIMSession* LLIMModel::findIMSession(const LLUUID& session_id) const
{
- return get_if_there(mId2SessionMap, session_id,
- (LLIMModel::LLIMSession*) NULL);
+ return get_if_there(mId2SessionMap, session_id, (LLIMModel::LLIMSession*) NULL);
}
//*TODO consider switching to using std::set instead of std::list for holding LLUUIDs across the whole code
@@ -995,6 +1009,7 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co
arg["from"] = from;
arg["from_id"] = from_id;
arg["time"] = LLLogChat::timestamp(false);
+ arg["session_type"] = session->mSessionType;
mNewMsgSignal(arg);
return true;
@@ -2638,7 +2653,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
@@ -2654,7 +2669,7 @@ void LLIMMgr::addMessage(
{
LLFloaterReg::showInstance("im_container");
LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")->
- flashConversationItemWidget(session_id, true);
+ flashConversationItemWidget(new_session_id, true);
}
}
@@ -2809,7 +2824,7 @@ LLUUID LLIMMgr::addSession(
}
}
- bool new_session = !LLIMModel::getInstance()->findIMSession(session_id);
+ bool new_session = (LLIMModel::getInstance()->findIMSession(session_id) == NULL);
//works only for outgoing ad-hoc sessions
if (new_session && IM_SESSION_CONFERENCE_START == dialog && ids.size())