summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-10-23 14:16:49 -0700
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-10-23 14:16:49 -0700
commit873d03e96f8fe10705e99a5ef1c1baca96fb2325 (patch)
tree94914fe6a2eaf5d748dbfea62c75de06afa95e96 /indra/newview
parent52a8ea96a1b9ad52a01c4617de63f8cc1bec1e31 (diff)
parenta780eb1a92811c2531c2fc1d211e8e5dd03da103 (diff)
Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui/.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimconversation.cpp11
-rw-r--r--indra/newview/llimview.cpp31
-rw-r--r--indra/newview/llimview.h7
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp17
4 files changed, 8 insertions, 58 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index bd2a2419a8..74bf8cb6fe 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -202,16 +202,9 @@ void LLIMConversation::onFocusReceived()
{
setBackgroundOpaque(true);
- if (mSessionID.notNull())
+ if (mSessionID.notNull() && isInVisibleChain())
{
- LLChicletBar::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true);
-
- if (getVisible())
- {
- // suppress corresponding toast only if this floater is visible and have focus
- LLIMModel::getInstance()->setActiveSessionID(mSessionID);
- LLIMModel::instance().sendNoUnreadMessages(mSessionID);
- }
+ LLIMModel::instance().sendNoUnreadMessages(mSessionID);
}
LLTransientDockableFloater::onFocusReceived();
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 115da54ec8..4c5631d5e1 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -118,12 +118,12 @@ void toast_callback(const LLSD& msg){
return;
}
- // check whether incoming IM belongs to an active session or not
- if (LLIMModel::getInstance()->getActiveSessionID().notNull()
- && LLIMModel::getInstance()->getActiveSessionID() == msg["session_id"])
- {
- return;
- }
+ // Skip toasting if we have open window of IM with this session id
+ LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]);
+ if (open_im_floater && open_im_floater->isInVisibleChain() && open_im_floater->hasFocus())
+ {
+ return;
+ }
// Skip toasting for system messages
if (msg["from_id"].asUUID() == LLUUID::null)
@@ -145,30 +145,11 @@ void toast_callback(const LLSD& msg){
return;
}
- // Skip toasting if we have open window of IM with this session id
- LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]);
- if (open_im_floater && open_im_floater->getVisible())
- {
- return;
- }
-
LLAvatarNameCache::get(msg["from_id"].asUUID(),
boost::bind(&on_avatar_name_cache_toast,
_1, _2, msg));
}
-void LLIMModel::setActiveSessionID(const LLUUID& session_id)
-{
- // check if such an ID really exists
- if (!findIMSession(session_id))
- {
- llwarns << "Trying to set as active a non-existent session!" << llendl;
- return;
- }
-
- mActiveSessionID = session_id;
-}
-
LLIMModel::LLIMModel()
{
addNewMsgCallback(boost::bind(&LLIMFloater::newIMCallback, _1));
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 00b67f520c..054388bc6c 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -147,13 +147,6 @@ public:
LLIMModel();
-
- //we should control the currently active session
- LLUUID mActiveSessionID;
- void setActiveSessionID(const LLUUID& session_id);
- void resetActiveSessionID() { mActiveSessionID.setNull(); }
- LLUUID getActiveSessionID() { return mActiveSessionID; }
-
/** Session id to session object */
std::map<LLUUID, LLIMSession*> mId2SessionMap;
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 9fd73746e8..b4e8927879 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -93,13 +93,6 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type,
}
else
{
- // store active session id
- const LLUUID & active_session_id =
- LLIMModel::instance().getActiveSessionID();
-
- // set searched session as active to avoid IM toast popup
- LLIMModel::instance().setActiveSessionID(session_id);
-
S32 unread = session->mNumUnread;
S32 participant_unread = session->mParticipantUnreadMessageCount;
LLIMModel::instance().addMessageSilently(session_id, from, from_id,
@@ -110,16 +103,6 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type,
// update IM floater messages
updateIMFLoaterMesages(session_id);
-
- // restore active session id
- if (active_session_id.isNull())
- {
- LLIMModel::instance().resetActiveSessionID();
- }
- else
- {
- LLIMModel::instance().setActiveSessionID(active_session_id);
- }
}
}