aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llimview.cpp')
-rw-r--r--linden/indra/newview/llimview.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp
index 797c2a4..e6169d5 100644
--- a/linden/indra/newview/llimview.cpp
+++ b/linden/indra/newview/llimview.cpp
@@ -69,9 +69,6 @@
69 69
70#include "llfirstuse.h" 70#include "llfirstuse.h"
71 71
72const EInstantMessage GROUP_DIALOG = IM_SESSION_GROUP_START;
73const EInstantMessage DEFAULT_DIALOG = IM_NOTHING_SPECIAL;
74
75// 72//
76// Globals 73// Globals
77// 74//
@@ -158,11 +155,12 @@ LLFloaterIM::LLFloaterIM()
158 155
159BOOL LLFloaterIM::postBuild() 156BOOL LLFloaterIM::postBuild()
160{ 157{
158 // IM session initiation warnings
161 sOnlyUserMessage = getString("only_user_message"); 159 sOnlyUserMessage = getString("only_user_message");
162 sOfflineMessage = getUIString("offline_message"); 160 sOfflineMessage = getUIString("offline_message");
161 sMutedMessage = getUIString("muted_message");
163 162
164 sInviteMessage = getUIString("invite_message"); 163 sInviteMessage = getUIString("invite_message");
165 sMutedMessage = childGetText("muted_message");
166 164
167 if ( sErrorStringsMap.find("generic") == sErrorStringsMap.end() ) 165 if ( sErrorStringsMap.find("generic") == sErrorStringsMap.end() )
168 { 166 {
@@ -617,7 +615,12 @@ LLUUID LLIMMgr::addSession(
617 615
618 noteOfflineUsers(floater, ids); 616 noteOfflineUsers(floater, ids);
619 LLFloaterChatterBox::showInstance(session_id); 617 LLFloaterChatterBox::showInstance(session_id);
620 noteMutedUsers(floater, ids); 618
619 // Only warn for regular IMs - not group IMs
620 if( dialog == IM_NOTHING_SPECIAL )
621 {
622 noteMutedUsers(floater, ids);
623 }
621 LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater); 624 LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
622 } 625 }
623 else 626 else
@@ -663,7 +666,12 @@ LLUUID LLIMMgr::addSession(
663 666
664 noteOfflineUsers(floater, ids); 667 noteOfflineUsers(floater, ids);
665 LLFloaterChatterBox::showInstance(session_id); 668 LLFloaterChatterBox::showInstance(session_id);
666 noteMutedUsers(floater, ids); 669
670 // Only warn for regular IMs - not group IMs
671 if( dialog == IM_NOTHING_SPECIAL )
672 {
673 noteMutedUsers(floater, ids);
674 }
667 } 675 }
668 else 676 else
669 { 677 {
@@ -1240,23 +1248,23 @@ void LLIMMgr::noteOfflineUsers(
1240void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater, 1248void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater,
1241 const LLDynamicArray<LLUUID>& ids) 1249 const LLDynamicArray<LLUUID>& ids)
1242{ 1250{
1251 // Don't do this if we don't have a mute list.
1252 LLMuteList *ml = LLMuteList::getInstance();
1253 if( !ml )
1254 {
1255 return;
1256 }
1257
1243 S32 count = ids.count(); 1258 S32 count = ids.count();
1244 if(count > 0) 1259 if(count > 0)
1245 { 1260 {
1246 const LLRelationship* info = NULL;
1247 LLAvatarTracker& at = LLAvatarTracker::instance();
1248 for(S32 i = 0; i < count; ++i) 1261 for(S32 i = 0; i < count; ++i)
1249 { 1262 {
1250 info = at.getBuddyInfo(ids.get(i)); 1263 if( ml->isMuted(ids.get(i)) )
1251 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1252 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1253 if(info && LLMuteList::getInstance() && LLMuteList::getInstance()->isMuted(ids.get(i))
1254 && gCacheName->getName(ids.get(i), first, last))
1255 { 1264 {
1256 LLUIString muted = sMutedMessage; 1265 LLUIString muted = sMutedMessage;
1257 muted.setArg("[FIRST]", first);
1258 muted.setArg("[LAST]", last);
1259 floater->addHistoryLine(muted); 1266 floater->addHistoryLine(muted);
1267 break;
1260 } 1268 }
1261 } 1269 }
1262 } 1270 }