From a03b3aaa60c4b9101d344eed70ddbbf14888ff48 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 12 Dec 2011 08:51:16 -0500 Subject: STORM-1731 Ad-hoc confererence block failing. Residents using it to start massive multi-sim conferences, used as a griefing tool. --- indra/newview/llimview.cpp | 55 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ed4bb727cd..daef307601 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2403,15 +2403,6 @@ void LLIMMgr::addMessage( bool link_name) // If this is true, then we insert the name and link it to a profile { LLUUID other_participant_id = target_id; - - // don't process muted IMs - if (LLMuteList::getInstance()->isMuted( - other_participant_id, - LLMute::flagTextChat) && !LLMuteList::getInstance()->isLinden(from)) - { - return; - } - LLUUID new_session_id = session_id; if (new_session_id.isNull()) { @@ -2452,10 +2443,25 @@ void LLIMMgr::addMessage( LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str()); } + // Logically it would make more sense to reject the session sooner, in another area of the + // code, but the session has to be established inside the server before it can be left. + if (LLMuteList::getInstance()->isMuted(other_participant_id) && !LLMuteList::getInstance()->isLinden(from)) + { + llwarns << "Leaving IM session from initiating muted resident " << from << llendl; + if(!gIMMgr->leaveSession(new_session_id)) + { + llwarns << "Session " << new_session_id << " does not exist." << llendl; + } + return; + } + make_ui_sound("UISndNewIncomingIMSession"); } - LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); + if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat)) + { + LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); + } } void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args) @@ -2661,12 +2667,6 @@ void LLIMMgr::inviteToSession( const std::string& session_handle, const std::string& session_uri) { - //ignore invites from muted residents - if (LLMuteList::getInstance()->isMuted(caller_id)) - { - return; - } - std::string notify_box_type; // voice invite question is different from default only for group call (EXT-7118) std::string question_type = "VoiceInviteQuestionDefault"; @@ -2712,6 +2712,22 @@ void LLIMMgr::inviteToSession( payload["notify_box_type"] = notify_box_type; payload["question_type"] = question_type; + if (voice_invite && + "VoiceInviteQuestionDefault" == question_type && + LLMuteList::getInstance()->isMuted(caller_id) && + !LLMuteList::getInstance()->isLinden(caller_name)) + { + llwarns << "Rejecting voice call from initiating muted resident " << caller_name << llendl; + LLIncomingCallDialog::processCallResponse(1, payload); + return; + } + + //ignore invites from muted residents + if (LLMuteList::getInstance()->isMuted(caller_id)) + { + return; + } + LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id); if (channelp && channelp->callStarted()) { @@ -3234,7 +3250,7 @@ public: chat.mFromID = from_id; chat.mFromName = name; - if (!is_linden && (is_busy || is_muted)) + if (!is_linden && is_busy) { return; } @@ -3266,6 +3282,11 @@ public: ll_vector3_from_sd(message_params["position"]), true); + if (LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat)) + { + return; + } + //K now we want to accept the invitation std::string url = gAgent.getRegion()->getCapability( "ChatSessionRequest"); -- cgit v1.2.3 From f2d2e7e489613769ca40cc838630b20c854942a5 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 12 Dec 2011 11:32:34 -0500 Subject: STORM-1731 Changes per RB comments: changed llwarns to llinfos, added check so you cannot mute a Linden --- indra/newview/llimview.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index daef307601..f96e7f2cc3 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2450,7 +2450,7 @@ void LLIMMgr::addMessage( llwarns << "Leaving IM session from initiating muted resident " << from << llendl; if(!gIMMgr->leaveSession(new_session_id)) { - llwarns << "Session " << new_session_id << " does not exist." << llendl; + llinfos << "Session " << new_session_id << " does not exist." << llendl; } return; } @@ -2673,6 +2673,9 @@ void LLIMMgr::inviteToSession( BOOL ad_hoc_invite = FALSE; BOOL voice_invite = FALSE; + bool is_linden = LLMuteList::getInstance()->isLinden(caller_name); + + if(type == IM_SESSION_P2P_INVITE) { //P2P is different...they only have voice invitations @@ -2715,15 +2718,15 @@ void LLIMMgr::inviteToSession( if (voice_invite && "VoiceInviteQuestionDefault" == question_type && LLMuteList::getInstance()->isMuted(caller_id) && - !LLMuteList::getInstance()->isLinden(caller_name)) + !is_linden) { - llwarns << "Rejecting voice call from initiating muted resident " << caller_name << llendl; + llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl; LLIncomingCallDialog::processCallResponse(1, payload); return; } //ignore invites from muted residents - if (LLMuteList::getInstance()->isMuted(caller_id)) + if (LLMuteList::getInstance()->isMuted(caller_id) && !is_linden) { return; } -- cgit v1.2.3 From 2c9db624fb6a463efbd8a208d6d7f3bae72c0211 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 12 Dec 2011 14:48:36 -0500 Subject: STORM-1731 Adjusted if muted logic slightly --- indra/newview/llimview.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index f96e7f2cc3..a856bd0bdc 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2714,20 +2714,15 @@ void LLIMMgr::inviteToSession( payload["session_uri"] = session_uri; payload["notify_box_type"] = notify_box_type; payload["question_type"] = question_type; - - if (voice_invite && - "VoiceInviteQuestionDefault" == question_type && - LLMuteList::getInstance()->isMuted(caller_id) && - !is_linden) - { - llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl; - LLIncomingCallDialog::processCallResponse(1, payload); - return; - } //ignore invites from muted residents if (LLMuteList::getInstance()->isMuted(caller_id) && !is_linden) { + if (voice_invite && "VoiceInviteQuestionDefault" == question_type) + { + llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl; + LLIncomingCallDialog::processCallResponse(1, payload); + } return; } -- cgit v1.2.3