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

@@ -940,6 +940,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<real>60.0</real>
</map>
<key>NewIMsPerConversation</key>
<map>
<key>Comment</key>
<string>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.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>ResetFocusOnSelfClick</key>
<map>
<key>Comment</key>

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)