diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d268b43e6..12a4cb890 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -940,6 +940,17 @@ This should be as low as possible, but too low may break functionality Value 60.0 + NewIMsPerConversation + + Comment + The New IMs button in the bottom left will show the count of unread conversations instead of the total count of unread IMs if this is true. + Persist + 1 + Type + Boolean + Value + 0 + ResetFocusOnSelfClick Comment diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index 114bc56f1..07357d32a 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -46,6 +46,7 @@ #include "llbutton.h" #include "llchatbar.h" #include "llfocusmgr.h" +#include "llimpanel.h" #include "llimview.h" #include "llmediaremotectrl.h" #include "llpanelaudiovolume.h" @@ -308,9 +309,22 @@ void LLOverlayBar::refresh() { bool buttons_changed = FALSE; - if(LLButton* button = updateButtonVisiblity(mNewIM,gIMMgr->getIMReceived())) + if (LLButton* button = updateButtonVisiblity(mNewIM,gIMMgr->getIMReceived())) { - int unread_count = gIMMgr->getIMUnreadCount(); + int unread_count(0); + static const LLCachedControl per_conversation("NewIMsPerConversation"); + if (per_conversation) + { + 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 + ++unread_count; + } + else + { + unread_count = gIMMgr->getIMUnreadCount(); + } + if (unread_count > 0) { if (unread_count > 1)