diff options
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)); |