summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-04-07 12:06:23 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-04-07 12:06:23 +0300
commitca446ad0b771fa4380bfdb671b1dc29e70a993bd (patch)
tree9485a7d9460f9528df5cef93c579304e7ebb3517
parent42471d556b6209ad830f11ddb158cd2f9d152850 (diff)
MAINT-5036 FIXED Blocked user can send invites to group
-rwxr-xr-xindra/newview/llmutelist.cpp16
-rwxr-xr-xindra/newview/llmutelist.h5
-rwxr-xr-xindra/newview/llviewermessage.cpp7
3 files changed, 27 insertions, 1 deletions
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp
index 65ac11092c..d79baf90e7 100755
--- a/indra/newview/llmutelist.cpp
+++ b/indra/newview/llmutelist.cpp
@@ -646,6 +646,22 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
return legacy_it != mLegacyMutes.end();
}
+BOOL LLMuteList::isMuted(const std::string& username, U32 flags) const
+{
+ mute_set_t::const_iterator mute_iter = mMutes.begin();
+ while(mute_iter != mMutes.end())
+ {
+ // can't convert "leha.test" into "LeHa TesT" so username comparison is more reliable
+ if (mute_iter->mType == LLMute::AGENT
+ && LLCacheName::buildUsername(mute_iter->mName) == username)
+ {
+ return TRUE;
+ }
+ mute_iter++;
+ }
+ return FALSE;
+}
+
//-----------------------------------------------------------------------------
// requestFromServer()
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h
index 3e998b4f0e..4e7b6ee880 100755
--- a/indra/newview/llmutelist.h
+++ b/indra/newview/llmutelist.h
@@ -101,7 +101,10 @@ public:
// Name is required to test against legacy text-only mutes.
BOOL isMuted(const LLUUID& id, const std::string& name = LLStringUtil::null, U32 flags = 0) const;
-
+
+ // Workaround for username-based mute search, a lot of string conversions so use cautiously
+ BOOL isMuted(const std::string& username, U32 flags = 0) const;
+
// Alternate (convenience) form for places we don't need to pass the name, but do need flags
BOOL isMuted(const LLUUID& id, U32 flags) const { return isMuted(id, LLStringUtil::null, flags); };
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 2704aa2050..99c7673f85 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2707,6 +2707,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
break;
case IM_GROUP_INVITATION:
{
+ if (!is_muted)
+ {
+ // group is not blocked, but we still need to check agent that sent the invitation
+ // and we have no agent's id
+ // Note: server sends username "first.last".
+ is_muted |= LLMuteList::getInstance()->isMuted(name);
+ }
if (is_do_not_disturb || is_muted)
{
send_do_not_disturb_message(msg, from_id);