diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e1ef1bbbbe..adb70296e1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14849,6 +14849,19 @@ Change of this parameter will affect the layout of buttons in notification toast Boolean Value 0 + + FSSearchGroupMaturity + + Comment + Setting for the user's group search maturity level (consts in indra_constants.h) + Persist + 1 + HideFromEditor + 1 + Type + U32 + Value + 13 ShowPGEvents diff --git a/indra/newview/fsfloatersearch.cpp b/indra/newview/fsfloatersearch.cpp index 6593622350..79647ba0e2 100644 --- a/indra/newview/fsfloatersearch.cpp +++ b/indra/newview/fsfloatersearch.cpp @@ -1169,34 +1169,32 @@ void FSPanelSearchGroups::find() return; } - static LLUICachedControl inc_pg("ShowPGSims", 1); - static LLUICachedControl inc_mature("ShowMatureSims", 0); - static LLUICachedControl inc_adult("ShowAdultSims", 0); - if (!(inc_pg || inc_mature || inc_adult)) + static LLUICachedControl search_maturity("FSSearchGroupMaturity", SIM_ACCESS_PG); + if (!search_maturity()) { LLNotificationsUtil::add("NoContentToSearch"); return; } - U32 scope = 0; + + U32 scope = DFQ_GROUPS; if (gAgent.wantsPGOnly()) { scope |= DFQ_PG_SIMS_ONLY; } bool adult_enabled = gAgent.canAccessAdult(); bool mature_enabled = gAgent.canAccessMature(); - if (inc_pg) + if (search_maturity >= SIM_ACCESS_PG) { scope |= DFQ_INC_PG; } - if (inc_mature && mature_enabled) + if (mature_enabled && search_maturity >= SIM_ACCESS_MATURE) { scope |= DFQ_INC_MATURE; } - if (inc_adult && adult_enabled) + if (adult_enabled && search_maturity >= SIM_ACCESS_ADULT) { scope |= DFQ_INC_ADULT; } - scope |= DFQ_GROUPS; mResultsReceived = 0; if (mQueryID.notNull()) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a82a9d4e80..086e3ebf20 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2938,12 +2938,19 @@ void LLFloaterPreference::onChangeMaturity() gSavedSettings.setBOOL("ShowMatureSims", false); gSavedSettings.setBOOL("ShowMatureLand", false); gSavedSettings.setBOOL("ShowMatureClassifieds", false); + gSavedSettings.setU32("FSSearchGroupMaturity", SIM_ACCESS_PG); // Fix legacy group search to better support maturity settings } if (!can_access_adult) { gSavedSettings.setBOOL("ShowAdultSims", false); gSavedSettings.setBOOL("ShowAdultLand", false); gSavedSettings.setBOOL("ShowAdultClassifieds", false); + // Fix legacy group search to better support maturity settings + if (can_access_mature) + { + gSavedSettings.setU32("FSSearchGroupMaturity", SIM_ACCESS_MATURE); + } + // } } diff --git a/indra/newview/llpaneldirgroups.cpp b/indra/newview/llpaneldirgroups.cpp index 8395b7cc4a..3a856ba55e 100644 --- a/indra/newview/llpaneldirgroups.cpp +++ b/indra/newview/llpaneldirgroups.cpp @@ -29,6 +29,7 @@ #include "llpaneldirgroups.h" #include "llagent.h" +#include "llnotificationsutil.h" // #include "llqueryflags.h" #include "llviewercontrol.h" #include "llsearcheditor.h" @@ -81,11 +82,35 @@ void LLPanelDirGroups::performQuery() U32 scope = DFQ_GROUPS; // Check group mature filter. - if ( !gSavedSettings.getBOOL("ShowMatureGroups") || gAgent.isTeen() ) + // Fix legacy group search to better support maturity settings + //if ( !gSavedSettings.getBOOL("ShowMatureGroups") || gAgent.isTeen() ) + //{ + // scope |= DFQ_FILTER_MATURE; + //} + bool adult_enabled = gAgent.canAccessAdult(); + bool mature_enabled = gAgent.canAccessMature(); + + static LLUICachedControl search_maturity("FSSearchGroupMaturity", SIM_ACCESS_PG); + if (!search_maturity()) { - scope |= DFQ_FILTER_MATURE; + LLNotificationsUtil::add("NoContentToSearch"); + return; } + if (search_maturity >= SIM_ACCESS_PG) + { + scope |= DFQ_INC_PG; + } + if (mature_enabled && search_maturity >= SIM_ACCESS_MATURE) + { + scope |= DFQ_INC_MATURE; + } + if (adult_enabled && search_maturity >= SIM_ACCESS_ADULT) + { + scope |= DFQ_INC_ADULT; + } + // + mCurrentSortColumn = "score"; mCurrentSortAscending = false; diff --git a/indra/newview/skins/default/xui/en/panel_dir_groups.xml b/indra/newview/skins/default/xui/en/panel_dir_groups.xml index 238f219f49..09a7f698e5 100644 --- a/indra/newview/skins/default/xui/en/panel_dir_groups.xml +++ b/indra/newview/skins/default/xui/en/panel_dir_groups.xml @@ -64,6 +64,7 @@ width="150"> Enter search terms: + + + + + + + - - - - - - + + + + +