Add NewIMsPerConversationReset to reset the visibility of the New IMs button when the communicate floater has been opened and closed and NewIMsPerConversation is in use

(this is now the default behavior of NewIMsPerConversation)
This commit is contained in:
Inusaito Sayori
2013-09-09 21:08:38 -04:00
parent 0b1a172a91
commit e36c0095e0
2 changed files with 17 additions and 6 deletions

View File

@@ -977,6 +977,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>NewIMsPerConversationReset</key>
<map>
<key>Comment</key>
<string>When NewIMsPerConversation is on, this determines when the New IMs button becomes visible while the communicate floater is closed. True will wait until a new IM is received, false displays as long as a conversation is unread.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>1</boolean>
</map>
<key>ResetFocusOnSelfClick</key>
<map>
<key>Comment</key>

View File

@@ -294,19 +294,19 @@ void LLOverlayBar::refresh()
{
bool buttons_changed = FALSE;
int count(0);
int unread_count(gIMMgr->getIMUnreadCount());
static const LLCachedControl<bool> per_conversation("NewIMsPerConversation");
if (per_conversation && !LLFloaterChatterBox::instanceVisible())
static const LLCachedControl<bool> reset_count("NewIMsPerConversationReset");
if (per_conversation && (!reset_count || unread_count) && !LLFloaterChatterBox::instanceVisible())
{
unread_count = 0;
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
++count;
++unread_count;
}
if (LLButton* button = updateButtonVisiblity(mNewIM, per_conversation ? count : gIMMgr->getIMReceived()))
if (LLButton* button = updateButtonVisiblity(mNewIM, unread_count))
{
int unread_count(per_conversation ? count : gIMMgr->getIMUnreadCount());
if (unread_count > 0)
{
if (unread_count > 1)