From 5828d061144fe1d15580dc6f9e00d7dcf93456ea Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 26 Oct 2016 15:10:40 +0300 Subject: SL-448 Implement a limit to block list --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llmutelist.cpp | 11 +++++++++++ indra/newview/skins/default/xui/en/notifications.xml | 11 ++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8836ed0e5e..c6347c3f65 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6617,6 +6617,17 @@ Boolean Value 0 + + MuteListLimit + + Comment + Maximum number of entries in the mute list + Persist + 1 + Type + S32 + Value + 1000 MyOutfitsAutofill diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 01cf68bcda..84cf7d0313 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -56,6 +56,7 @@ #include "llworld.h" //for particle system banning #include "llimview.h" #include "llnotifications.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "lltrans.h" @@ -231,6 +232,16 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) return FALSE; } + S32 mute_list_limit = gSavedSettings.getS32("MuteListLimit"); + if (getMutes().size() >= mute_list_limit) + { + LL_WARNS() << "Mute limit is reached; ignored" << LL_ENDL; + LLSD args; + args["MUTE_LIMIT"] = mute_list_limit; + LLNotifications::instance().add(LLNotification::Params("MuteLimitReached").substitutions(args)); + return FALSE; + } + if (mute.mType == LLMute::BY_NAME) { // Can't mute empty string by name diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 65ab3f001f..db90e6a163 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1886,7 +1886,16 @@ Go to [_URL] for information on purchasing L$? notext="Cancel" yestext="OK"/> - + + +Unable to add new entry to block list because you reached the limit of [MUTE_LIMIT] entries. + fail + +