Feature Request: Ability to have the New IMs button display the amount of unread conversations instead of the amount of new IMs therein

Set NewIMsPerConversation true to activate.
This commit is contained in:
Inusaito Sayori
2013-08-28 00:35:31 -04:00
parent 9c80f58d34
commit c57191b951
2 changed files with 27 additions and 2 deletions

View File

@@ -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<bool> per_conversation("NewIMsPerConversation");
if (per_conversation)
{
for(std::set<LLHandle<LLFloater> >::const_iterator it = gIMMgr->getIMFloaterHandles().begin(); it != gIMMgr->getIMFloaterHandles().end(); ++it)
if (LLFloaterIMPanel* im_floater = static_cast<LLFloaterIMPanel*>(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)