Fix legacy group search to better support maturity settings

This commit is contained in:
Hecklezz
2026-05-20 02:58:30 +10:00
parent e57418a27f
commit d141b9045c
6 changed files with 104 additions and 75 deletions
+13
View File
@@ -14849,6 +14849,19 @@ Change of this parameter will affect the layout of buttons in notification toast
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSSearchGroupMaturity</key>
<map>
<key>Comment</key>
<string>Setting for the user's group search maturity level (consts in indra_constants.h)</string>
<key>Persist</key>
<integer>1</integer>
<key>HideFromEditor</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>13</integer>
</map>
<key>ShowPGEvents</key>
<map>
+7 -9
View File
@@ -1169,34 +1169,32 @@ void FSPanelSearchGroups::find()
return;
}
static LLUICachedControl<bool> inc_pg("ShowPGSims", 1);
static LLUICachedControl<bool> inc_mature("ShowMatureSims", 0);
static LLUICachedControl<bool> inc_adult("ShowAdultSims", 0);
if (!(inc_pg || inc_mature || inc_adult))
static LLUICachedControl<U32> 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())
+7
View File
@@ -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); // <FS:TJ/> 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);
// <FS:TJ/> Fix legacy group search to better support maturity settings
if (can_access_mature)
{
gSavedSettings.setU32("FSSearchGroupMaturity", SIM_ACCESS_MATURE);
}
// </FS:TJ>
}
}
+27 -2
View File
@@ -29,6 +29,7 @@
#include "llpaneldirgroups.h"
#include "llagent.h"
#include "llnotificationsutil.h" // <FS:TJ/>
#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() )
// <FS:TJ> 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<U32> 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;
}
// </FS:TJ>
mCurrentSortColumn = "score";
mCurrentSortAscending = false;
@@ -64,6 +64,7 @@
width="150">
Enter search terms:
</text>
<!-- <FS:TJ> Fix legacy group search to better support maturity settings
<check_box
top_delta="0"
control_name="ShowMatureGroups"
@@ -76,7 +77,32 @@
left="510"
mouse_opaque="true"
name="incmature"
width="100" />
width="100" /> -->
<combo_box
control_name="FSSearchGroupMaturity"
follows="right|top"
layout="topleft"
height="18"
allow_text_entry="false"
left="609"
top_delta="-2"
left_pad="2"
name="groups_maturity"
width="167">
<combo_box.item
label="General"
name="Desired_PG"
value="13" />
<combo_box.item
label="General and Moderate"
name="Desired_Mature"
value="21" />
<combo_box.item
label="General, Moderate, Adult"
name="Desired_Adult"
value="42" />
</combo_box>
<!-- </FS:TJ> -->
<search_combo_box
layout="topleft"
follows="left|top|right"
@@ -38,69 +38,29 @@
top="29"
width="770">
</search_combo_box>
<check_box
control_name="ShowPGGroups"
follows="right|top"
height="16"
label=""
layout="topleft"
left="660"
name="pg_all"
top="12"
width="15"
visible="false"/>
<icon
follows="right|top"
height="16"
image_name="Parcel_PG_Dark"
layout="topleft"
left_pad="2"
name="rating_icon_general"
top_delta="-1"
width="18"
visible="false"/>
<check_box
control_name="ShowMatureGroups"
follows="right|top"
height="16"
label=""
layout="topleft"
left_pad="2"
name="mature_all"
top_delta="1"
width="15"
visible="false"/>
<icon
follows="right|top"
height="16"
image_name="Parcel_M_Dark"
layout="topleft"
left_pad="2"
name="rating_icon_moderate"
top_delta="-1"
width="18"
visible="false"/>
<check_box
control_name="ShowAdultGroups"
follows="right|top"
height="16"
label=""
layout="topleft"
left_pad="2"
name="adult_all"
top_delta="1"
width="15"
visible="false"/>
<icon
follows="right|top"
height="16"
image_name="Parcel_R_Dark"
layout="topleft"
left_pad="2"
name="rating_icon_adult"
top_delta="-1"
width="18"
visible="false"/>
<combo_box
control_name="FSSearchGroupMaturity"
follows="right|top"
layout="topleft"
height="23"
allow_text_entry="false"
top="4"
left="609"
name="groups_maturity"
width="167">
<combo_box.item
label="General"
name="Desired_PG"
value="13" />
<combo_box.item
label="General and Moderate"
name="Desired_Mature"
value="21" />
<combo_box.item
label="General, Moderate, Adult"
name="Desired_Adult"
value="42" />
</combo_box>
</panel>
<!-- Search Pane -->
<panel