diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a943565fb..403c612c4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -977,6 +977,17 @@ This should be as low as possible, but too low may break functionality Value 0 + NewIMsPerConversationReset + + Comment + When NewIMsPerConversation is on, this determines when the New IMs button becomes visible while the communicate floater is closed. True will wait until a new IM is received, false displays as long as a conversation is unread. + Persist + 1 + Type + Boolean + Value + 1 + ResetFocusOnSelfClick Comment diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index c43dfb42e..9bbf00567 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -294,19 +294,19 @@ void LLOverlayBar::refresh() { bool buttons_changed = FALSE; - int count(0); + int unread_count(gIMMgr->getIMUnreadCount()); static const LLCachedControl per_conversation("NewIMsPerConversation"); - if (per_conversation && !LLFloaterChatterBox::instanceVisible()) + static const LLCachedControl reset_count("NewIMsPerConversationReset"); + if (per_conversation && (!reset_count || unread_count) && !LLFloaterChatterBox::instanceVisible()) { + unread_count = 0; for(std::set >::const_iterator it = gIMMgr->getIMFloaterHandles().begin(); it != gIMMgr->getIMFloaterHandles().end(); ++it) if (LLFloaterIMPanel* im_floater = static_cast(it->get())) if (im_floater->getParent() != gFloaterView && im_floater->getNumUnreadMessages()) // Only count docked IMs - ++count; + ++unread_count; } - if (LLButton* button = updateButtonVisiblity(mNewIM, per_conversation ? count : gIMMgr->getIMReceived())) + if (LLButton* button = updateButtonVisiblity(mNewIM, unread_count)) { - int unread_count(per_conversation ? count : gIMMgr->getIMUnreadCount()); - if (unread_count > 0) { if (unread_count > 1)