From c48e644220ad1708a93987faf9ac96bcdd097dec Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Wed, 20 Feb 2013 17:11:50 +0200 Subject: CHUI-773 ADD FIX Conversation line item does not flash for unselected conversation when Flash Toolbar Button preference is selected : repair case "open and not on top" --- indra/newview/llimview.cpp | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cf6a215970..d69bd89f13 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -199,8 +199,14 @@ void on_new_message(const LLSD& msg) // execution of the action LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance("im_container"); - LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); + if (im_box->isFrontmost() && im_box->getSelectedSession() == session_id) + { + 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(); @@ -250,25 +256,21 @@ void on_new_message(const LLSD& msg) else if ("flash" == action) { - if (conversation_floater_not_focused) + if (!gAgent.isDoNotDisturb()) { - if(!session_floater_is_open && !gAgent.isDoNotDisturb()) - { - //User is not focused on conversation containing the message - gToolBarView->flashCommand(LLCommandId("chat"), true); - } - - im_box->flashConversationItemWidget(session_id, true); - - //If a DND message, allow notification to be stored so upon DND exit - //useMostItrusiveIMNotification will be called to notify user a message exists - if(session_id.notNull() - && participant_id.notNull() - && gAgent.isDoNotDisturb()) - { - LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); - } - } + im_box->flashConversationItemWidget(session_id, true); + if(conversation_floater_not_focused) + { + //User is not focused on conversation containing the message + gToolBarView->flashCommand(LLCommandId("chat"), true); + } + } + else if(session_id.notNull() && participant_id.notNull()) + { + //If a DND message, allow notification to be stored so upon DND exit + //useMostItrusiveIMNotification will be called to notify user a message exists + LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); + } } else if("openconversations" == action && !session_floater_is_open) -- cgit v1.2.3