diff options
| author | William Todd Stinson <stinson@lindenlab.com> | 2012-10-23 14:16:49 -0700 |
|---|---|---|
| committer | William Todd Stinson <stinson@lindenlab.com> | 2012-10-23 14:16:49 -0700 |
| commit | 873d03e96f8fe10705e99a5ef1c1baca96fb2325 (patch) | |
| tree | 94914fe6a2eaf5d748dbfea62c75de06afa95e96 /indra/newview/llimview.cpp | |
| parent | 52a8ea96a1b9ad52a01c4617de63f8cc1bec1e31 (diff) | |
| parent | a780eb1a92811c2531c2fc1d211e8e5dd03da103 (diff) | |
Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui/.
Diffstat (limited to 'indra/newview/llimview.cpp')
| -rw-r--r-- | indra/newview/llimview.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
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)); |
