diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index b4a8d42832..99b18833cd 100755
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -40,6 +40,9 @@
// [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5)
#include "llchannelmanager.h"
// [/SL:KB]
+// Unread IMs counter in window title
+#include "llviewerwindow.h"
+//
// Firestorm includes
#include "fsfloaterim.h"
@@ -53,6 +56,10 @@
#include "lltransientfloatermgr.h"
#include "llvoiceclient.h"
+// Unread IMs counter in window title
+extern std::string gWindowTitle;
+//
+
static LLDefaultChildRegistry::Register t1("chiclet_panel");
static LLDefaultChildRegistry::Register t2("chiclet_notification");
static LLDefaultChildRegistry::Register t6("chiclet_script");
@@ -274,6 +281,24 @@ void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
mFlashToLitTimer->stopFlashing();
}
+ // Unread IMs counter in window title
+ std::string window_title;
+ if (counter > 99)
+ {
+ window_title = "(99+) " + gWindowTitle;
+ }
+ else if (counter > 0)
+ {
+ window_title = "(" + llformat("%d", counter) + ") " + gWindowTitle;
+ }
+ else
+ {
+ window_title = gWindowTitle;
+ }
+ LLStringUtil::truncate(window_title, 255);
+ gViewerWindow->getWindow()->setTitle(window_title);
+ //
+
setCounter(counter);
}
// [FS communication UI]