Append the count of unread IMs to the IM session's name in the communicate button's flyout list

ShowUnreadIMsCount can be set false to turn this off
This commit is contained in:
Inusaito Sayori
2013-08-24 19:20:56 -04:00
parent a4802a4511
commit 0c40a38a45
3 changed files with 32 additions and 1 deletions

View File

@@ -389,8 +389,26 @@ void LLToolBar::updateCommunicateList()
LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get();
if (im_floaterp)
{
std::string floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : "";
static LLCachedControl<bool> show_counts("ShowUnreadIMsCounts", true);
S32 count = im_floaterp->getNumUnreadMessages();
std::string floater_title;
if (count > 0) floater_title = "*";
floater_title.append(im_floaterp->getShortTitle());
if (show_counts && count > 0)
{
floater_title += " - ";
if (count > 1)
{
LLStringUtil::format_map_t args;
args["COUNT"] = llformat("%d", count);
floater_title += getString("IMs", args);
}
else
{
floater_title += getString("IM");
}
}
itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP);
if (im_floaterp == frontmost_floater)
{