aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterchatterbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterchatterbox.cpp')
-rw-r--r--linden/indra/newview/llfloaterchatterbox.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/linden/indra/newview/llfloaterchatterbox.cpp b/linden/indra/newview/llfloaterchatterbox.cpp
index 53a2cf5..5ef5a30 100644
--- a/linden/indra/newview/llfloaterchatterbox.cpp
+++ b/linden/indra/newview/llfloaterchatterbox.cpp
@@ -89,8 +89,8 @@ void* LLFloaterMyFriends::createGroupsPanel(void* data)
89// LLFloaterChatterBox 89// LLFloaterChatterBox
90// 90//
91 91
92static std::string sTitle = "Communicate"; 92static std::string sTitle = "";
93static int sUnreadCount = 0; 93static int sIMUnreadCount = 0;
94 94
95LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : 95LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) :
96 mActiveVoiceFloater(NULL) 96 mActiveVoiceFloater(NULL)
@@ -127,7 +127,6 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) :
127 } 127 }
128 mTabContainer->lockTabs(); 128 mTabContainer->lockTabs();
129 129
130 sUnreadCount = 0;
131 sTitle = getTitle(); 130 sTitle = getTitle();
132} 131}
133 132
@@ -228,25 +227,25 @@ void LLFloaterChatterBox::markAsUnread(bool unread)
228{ 227{
229 LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance(); 228 LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance();
230 229
231 // Update IM unread count 230 // Update IM unread count here as tabs are clicked
232 if (unread) 231 if (unread)
233 { 232 {
234 sUnreadCount++; 233 sIMUnreadCount++;
235 } 234 }
236 else if (!unread) 235 else
237 { 236 {
238 sUnreadCount--; 237 sIMUnreadCount--;
239 } 238 }
240 239
241 if (floater) 240 if (floater)
242 { 241 {
243 // Update the title message with the number of unread IMs. 242 // Update the title message with the number of unread IMs.
244 // Remove the message when we hit 0. 243 // Remove the message when we hit 0.
245 if (sUnreadCount > 0) 244 if (sIMUnreadCount > 0)
246 { 245 {
247 // Check for plurals 246 // Check for plurals
248 std::string unread_string; 247 std::string unread_string;
249 if (sUnreadCount == 1) 248 if (sIMUnreadCount == 1)
250 { 249 {
251 unread_string = floater->getString("unread_count_string_singular"); 250 unread_string = floater->getString("unread_count_string_singular");
252 } 251 }
@@ -256,14 +255,14 @@ void LLFloaterChatterBox::markAsUnread(bool unread)
256 } 255 }
257 256
258 std::ostringstream unread_count_message; 257 std::ostringstream unread_count_message;
259 unread_count_message << sTitle << " (" << sUnreadCount << " " << unread_string << ")"; 258 unread_count_message << sTitle << " - " << sIMUnreadCount << " " << unread_string;
260 259
261 // Update the floater title 260 // Update the floater title
262 floater->setTitle(unread_count_message.str()); 261 floater->setTitle(unread_count_message.str());
263 } 262 }
264 else 263 else
265 { 264 {
266 sUnreadCount = 0; 265 sIMUnreadCount = 0;
267 266
268 // Update the floater title 267 // Update the floater title
269 floater->setTitle(sTitle); 268 floater->setTitle(sTitle);