summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index ca04d27d11..141d43c608 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -174,6 +174,7 @@ void on_new_message(const LLSD& msg)
// determine state of conversations floater
enum {CLOSED, NOT_ON_TOP, ON_TOP, ON_TOP_AND_ITEM_IS_SELECTED} conversations_floater_status;
+
LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id);
@@ -181,19 +182,18 @@ void on_new_message(const LLSD& msg)
{
conversations_floater_status = CLOSED;
}
- else if (!im_box->isFrontmost() &&
- (!session_floater || !LLFloater::isVisible(session_floater)
- || session_floater->isMinimized() || !session_floater->isFrontmost()))
+ else if (!session_floater || !LLFloater::isVisible(session_floater)
+ || session_floater->isMinimized() || !session_floater->hasFocus())
{
conversations_floater_status = NOT_ON_TOP;
}
- else if (im_box->getSelectedSession() != session_id)
+ else if ((session_floater->hasFocus()) && (im_box->getSelectedSession() == session_id))
{
- conversations_floater_status = ON_TOP;
+ conversations_floater_status = ON_TOP_AND_ITEM_IS_SELECTED;
}
else
{
- conversations_floater_status = ON_TOP_AND_ITEM_IS_SELECTED;
+ conversations_floater_status = ON_TOP;
}
// determine user prefs for this session
@@ -274,7 +274,9 @@ 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
+ || ("toast" == user_preferences && ON_TOP != conversations_floater_status)
+ || ("flash" == user_preferences && CLOSED == conversations_floater_status))
{
if(!LLMuteList::getInstance()->isMuted(participant_id))
{
@@ -283,7 +285,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,10 +297,11 @@ void on_new_message(const LLSD& msg)
}
// 4. Toast
- if (("toast" == user_preferences &&
+ if ((("toast" == user_preferences) &&
(CLOSED == conversations_floater_status
|| NOT_ON_TOP == conversations_floater_status))
|| !session_floater->isMessagePaneExpanded())
+
{
//Show IM toasts (upper right toasts)
// Skip toasting for system messages and for nearby chat
@@ -2841,6 +2844,8 @@ LLUUID LLIMMgr::addSession(
//we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions
if (!new_session) return session_id;
+ llinfos << "LLIMMgr::addSession, new session added, name = " << name << ", session id = " << session_id << llendl;
+
//Per Plan's suggestion commented "explicit offline status warning" out to make Dessie happier (see EXT-3609)
//*TODO After February 2010 remove this commented out line if no one will be missing that warning
//noteOfflineUsers(session_id, floater, ids);
@@ -2876,6 +2881,8 @@ void LLIMMgr::removeSession(const LLUUID& session_id)
LLIMModel::getInstance()->clearSession(session_id);
+ llinfos << "LLIMMgr::removeSession, session removed, session id = " << session_id << llendl;
+
notifyObserverSessionRemoved(session_id);
}