From ae88605f72ef43be7b619b8c1c11a508ebae5057 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:46:01 -0500 Subject: Second Life viewer sources 1.20.14 --- linden/indra/newview/llimview.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'linden/indra/newview/llimview.cpp') 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 @@ #include "llfirstuse.h" -const EInstantMessage GROUP_DIALOG = IM_SESSION_GROUP_START; -const EInstantMessage DEFAULT_DIALOG = IM_NOTHING_SPECIAL; - // // Globals // @@ -158,11 +155,12 @@ LLFloaterIM::LLFloaterIM() BOOL LLFloaterIM::postBuild() { + // IM session initiation warnings sOnlyUserMessage = getString("only_user_message"); sOfflineMessage = getUIString("offline_message"); + sMutedMessage = getUIString("muted_message"); sInviteMessage = getUIString("invite_message"); - sMutedMessage = childGetText("muted_message"); if ( sErrorStringsMap.find("generic") == sErrorStringsMap.end() ) { @@ -617,7 +615,12 @@ LLUUID LLIMMgr::addSession( noteOfflineUsers(floater, ids); LLFloaterChatterBox::showInstance(session_id); - noteMutedUsers(floater, ids); + + // Only warn for regular IMs - not group IMs + if( dialog == IM_NOTHING_SPECIAL ) + { + noteMutedUsers(floater, ids); + } LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater); } else @@ -663,7 +666,12 @@ LLUUID LLIMMgr::addSession( noteOfflineUsers(floater, ids); LLFloaterChatterBox::showInstance(session_id); - noteMutedUsers(floater, ids); + + // Only warn for regular IMs - not group IMs + if( dialog == IM_NOTHING_SPECIAL ) + { + noteMutedUsers(floater, ids); + } } else { @@ -1240,23 +1248,23 @@ void LLIMMgr::noteOfflineUsers( void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater, const LLDynamicArray& ids) { + // Don't do this if we don't have a mute list. + LLMuteList *ml = LLMuteList::getInstance(); + if( !ml ) + { + return; + } + S32 count = ids.count(); if(count > 0) { - const LLRelationship* info = NULL; - LLAvatarTracker& at = LLAvatarTracker::instance(); for(S32 i = 0; i < count; ++i) { - info = at.getBuddyInfo(ids.get(i)); - char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - if(info && LLMuteList::getInstance() && LLMuteList::getInstance()->isMuted(ids.get(i)) - && gCacheName->getName(ids.get(i), first, last)) + if( ml->isMuted(ids.get(i)) ) { LLUIString muted = sMutedMessage; - muted.setArg("[FIRST]", first); - muted.setArg("[LAST]", last); floater->addHistoryLine(muted); + break; } } } -- cgit v1.1