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:
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user