Fix ShowHiddenThings

This commit is contained in:
Vendicated 2024-06-19 16:45:48 +02:00
parent 28ddadf732
commit d12624ac4b
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -64,18 +64,18 @@ export default definePlugin({
}, },
}, },
{ {
find: "useShouldShowInvitesDisabledNotif:", find: "2022-07_invites_disabled",
predicate: () => settings.store.showInvitesPaused, predicate: () => settings.store.showInvitesPaused,
replacement: { replacement: {
match: /\i\.\i\.can\(\i\.Permissions.MANAGE_GUILD,\i\)/, match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,
replace: "true", replace: "true",
}, },
}, },
{ {
find: "canAccessGuildMemberModViewWithExperiment:", find: /context:\i,checkElevated:!1\}\),\i\.\i.{0,200}autoTrackExposure/,
predicate: () => settings.store.showModView, predicate: () => settings.store.showModView,
replacement: { replacement: {
match: /return \i\.hasAny\(\i\.computePermissions\(\{user:\i,context:\i,checkElevated:!1\}\),\i\.MemberSafetyPagePermissions\)/, match: /return \i\.\i\(\i\.\i\(\{user:\i,context:\i,checkElevated:!1\}\),\i\.\i\)/,
replace: "return true", replace: "return true",
} }
}, },
@ -87,28 +87,31 @@ export default definePlugin({
replace: "{}" replace: "{}"
} }
}, },
// remove the 200 server minimum
{ {
find: "MINIMUM_MEMBER_COUNT:", find: '">200"',
predicate: () => settings.store.disableDiscoveryFilters, predicate: () => settings.store.disableDiscoveryFilters,
replacement: { replacement: {
match: /MINIMUM_MEMBER_COUNT:function\(\)\{return \i}/, match: '">200"',
replace: "MINIMUM_MEMBER_COUNT:() => \">0\"" replace: '">0"'
} }
}, },
// empty word filter (why would anyone search "horny" in fucking server discovery... please... why are we patching this again??)
{ {
find: "DiscoveryBannedSearchWords.includes", find: '"horny","fart"',
predicate: () => settings.store.disableDisallowedDiscoveryFilters, predicate: () => settings.store.disableDisallowedDiscoveryFilters,
replacement: { replacement: {
match: /(?<=function\(\){)(?=.{0,130}DiscoveryBannedSearchWords\.includes)/, match: /=\["egirl",.+?\]/,
replace: "return false;" replace: "=[]"
} }
}, },
// patch request that queries if term is allowed
{ {
find: "Endpoints.GUILD_DISCOVERY_VALID_TERM", find: ".GUILD_DISCOVERY_VALID_TERM",
predicate: () => settings.store.disableDisallowedDiscoveryFilters, predicate: () => settings.store.disableDisallowedDiscoveryFilters,
all: true, all: true,
replacement: { replacement: {
match: /\i\.HTTP\.get\(\{url:\i\.Endpoints\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0\}\);/g, match: /\i\.\i\.get\(\{url:\i\.\i\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0\}\);/g,
replace: "Promise.resolve({ body: { valid: true } });" replace: "Promise.resolve({ body: { valid: true } });"
} }
} }