diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index e63c84cfd26973347c54b11b557086f2dc43af11..f76f8ea22e6227b2f0354dfbfa2f6f0f8c3fc007 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -497,6 +497,8 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id) LLGroupData group_data; if (gAgent.getGroupData(group_id, group_data)) { + // Unmute the group if the user tries to start a session with it. + LLMuteList::instance().removeGroup(group_id); LLUUID session_id = gIMMgr->addSession( group_data.mName, IM_SESSION_GROUP_START, diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 35235d31e5d1293b7019254c1676186b69439c2a..075d44b9e29a611059eecb4506db5884e68a5f55 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2780,7 +2780,8 @@ void LLIMMgr::addMessage( // // 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, LLMute::flagTextChat) && !from_linden) +// if ((LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden) + || LLMuteList::getInstance()->isGroupMuted(new_session_id)) // { // LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL; // if (!gIMMgr->leaveSession(new_session_id)) diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 625f04589f814f2508a13947c1abf18f9a79e2b4..c6102a9d722db0d9578c58d4a81062900c7c28bd 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -70,7 +70,7 @@ namespace { // This method is used to return an object to mute given an object id. // Its used by the LLMute constructor and LLMuteList::isMuted. - LLViewerObject* get_object_to_mute_from_id(LLUUID object_id) + LLViewerObject* get_object_to_mute_from_id(const LLUUID& object_id) { LLViewerObject *objectp = gObjectList.findObject(object_id); if ((objectp) && (!objectp->isAvatar())) @@ -793,6 +793,25 @@ void LLMuteList::cache(const LLUUID& agent_id) } } +//----------------------------------------------------------------------------- +// Group muting +//----------------------------------------------------------------------------- + +BOOL LLMuteList::addGroup(const LLUUID& group_id) +{ + return add(LLMute(LLUUID::null, std::string("Group:" + group_id.asString()), LLMute::BY_NAME)); +} + +BOOL LLMuteList::removeGroup(const LLUUID& group_id) +{ + return remove(LLMute(LLUUID::null, std::string("Group:" + group_id.asString()), LLMute::BY_NAME)); +} + +BOOL LLMuteList::isGroupMuted(const LLUUID& group_id) +{ + return isMuted(LLUUID::null, std::string("Group:" + group_id.asString())); +} + //----------------------------------------------------------------------------- // Static message handlers //----------------------------------------------------------------------------- diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 234a2aa28ee838fc4999487b7727c57fa840a95c..34ae0201b5d1f34bf91e1e501b462ec3d6677f6b 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -117,6 +117,11 @@ class LLMuteList final : public LLSingleton<LLMuteList> // call this method on logout to save everything. void cache(const LLUUID& agent_id); + // group functions + BOOL addGroup(const LLUUID& group_id); + BOOL removeGroup(const LLUUID& group_id); + BOOL isGroupMuted(const LLUUID& group_id); + private: BOOL loadFromFile(const std::string& filename); BOOL saveToFile(const std::string& filename);