Skip to content

Commit c57191b

Browse files
committed
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.
1 parent 9c80f58 commit c57191b

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

indra/newview/app_settings/settings.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,17 @@ This should be as low as possible, but too low may break functionality</string>
940940
<key>Value</key>
941941
<real>60.0</real>
942942
</map>
943+
<key>NewIMsPerConversation</key>
944+
<map>
945+
<key>Comment</key>
946+
<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>
947+
<key>Persist</key>
948+
<integer>1</integer>
949+
<key>Type</key>
950+
<string>Boolean</string>
951+
<key>Value</key>
952+
<boolean>0</boolean>
953+
</map>
943954
<key>ResetFocusOnSelfClick</key>
944955
<map>
945956
<key>Comment</key>

indra/newview/lloverlaybar.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "llbutton.h"
4747
#include "llchatbar.h"
4848
#include "llfocusmgr.h"
49+
#include "llimpanel.h"
4950
#include "llimview.h"
5051
#include "llmediaremotectrl.h"
5152
#include "llpanelaudiovolume.h"
@@ -308,9 +309,22 @@ void LLOverlayBar::refresh()
308309
{
309310
bool buttons_changed = FALSE;
310311

311-
if(LLButton* button = updateButtonVisiblity(mNewIM,gIMMgr->getIMReceived()))
312+
if (LLButton* button = updateButtonVisiblity(mNewIM,gIMMgr->getIMReceived()))
312313
{
313-
int unread_count = gIMMgr->getIMUnreadCount();
314+
int unread_count(0);
315+
static const LLCachedControl<bool> per_conversation("NewIMsPerConversation");
316+
if (per_conversation)
317+
{
318+
for(std::set<LLHandle<LLFloater> >::const_iterator it = gIMMgr->getIMFloaterHandles().begin(); it != gIMMgr->getIMFloaterHandles().end(); ++it)
319+
if (LLFloaterIMPanel* im_floater = static_cast<LLFloaterIMPanel*>(it->get()))
320+
if (im_floater->getParent() != gFloaterView && im_floater->getNumUnreadMessages()) // Only count docked IMs
321+
++unread_count;
322+
}
323+
else
324+
{
325+
unread_count = gIMMgr->getIMUnreadCount();
326+
}
327+
314328
if (unread_count > 0)
315329
{
316330
if (unread_count > 1)

0 commit comments

Comments
 (0)