From ed99ae7f2383ffbecfff010ac1de9244038bbe8b Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:22:43 -0300 Subject: [PATCH 1/2] ShowHiddenThings: Fix showing ModView --- src/plugins/customRPC/index.tsx | 15 +++++++++++++-- src/plugins/fakeNitro/index.tsx | 2 +- src/plugins/showHiddenThings/index.ts | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/plugins/customRPC/index.tsx b/src/plugins/customRPC/index.tsx index 64aea76a..6f771933 100644 --- a/src/plugins/customRPC/index.tsx +++ b/src/plugins/customRPC/index.tsx @@ -31,7 +31,7 @@ import { findByCodeLazy, findComponentByCodeLazy } from "@webpack"; import { ApplicationAssetUtils, Button, FluxDispatcher, Forms, React, UserStore } from "@webpack/common"; const useProfileThemeStyle = findByCodeLazy("profileThemeStyle:", "--profile-gradient-primary-color"); -const ActivityView = findComponentByCodeLazy('location:"UserProfileActivityCard",'); +const ActivityView = findComponentByCodeLazy(".party?(0", ".card"); const ShowCurrentGame = getUserSettingLazy("status", "showCurrentGame")!; @@ -399,6 +399,17 @@ export default definePlugin({ stop: () => setRpc(true), settings, + patches: [ + { + find: ".party?(0", + all: true, + replacement: { + match: /\i\.id===\i\.id\?null:/, + replace: "" + } + } + ], + settingsAboutComponent: () => { const activity = useAwaiter(createActivity); const gameActivityEnabled = ShowCurrentGame.useSetting(); @@ -449,7 +460,7 @@ export default definePlugin({ {activity[0] && } diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 68e6cf99..df8b4cd8 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -391,7 +391,7 @@ export default definePlugin({ }, // Separate patch for allowing using custom app icons { - find: /\.getCurrentDesktopIcon.{0,25}\.isPremium/, + find: "?24:30,", replacement: { match: /\i\.\i\.isPremium\(\i\.\i\.getCurrentUser\(\)\)/, replace: "true" diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index 6ee131a8..7fba0131 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -58,7 +58,7 @@ export default definePlugin({ }, }, { - find: /context:\i,checkElevated:!1\}\),\i\.\i.{0,200}autoTrackExposure/, + find: /,checkElevated:!1}\),\i\.\i\)}(?<=getCurrentUser\(\);return.+?)/, predicate: () => settings.store.showModView, replacement: { match: /return \i\.\i\(\i\.\i\(\{user:\i,context:\i,checkElevated:!1\}\),\i\.\i\)/, From 30647b6bd9f61e80a2bde2eb259887f6eb3b171e Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:44:52 -0300 Subject: [PATCH 2/2] Fix patches with duplicate finds --- src/plugins/alwaysAnimate/index.ts | 2 +- src/plugins/forceOwnerCrown/index.ts | 2 +- src/plugins/moreUserTags/index.tsx | 2 +- src/plugins/noUnblockToJump/index.ts | 2 +- src/plugins/reverseImageSearch/index.tsx | 2 +- src/plugins/showHiddenThings/index.ts | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/alwaysAnimate/index.ts b/src/plugins/alwaysAnimate/index.ts index 97593990..fc528466 100644 --- a/src/plugins/alwaysAnimate/index.ts +++ b/src/plugins/alwaysAnimate/index.ts @@ -41,7 +41,7 @@ export default definePlugin({ }, { // Status emojis - find: "#{intl::GUILD_OWNER}", + find: "#{intl::GUILD_OWNER}),children:", replacement: { match: /(?<=\.activityEmoji,.+?animate:)\i/, replace: "!0" diff --git a/src/plugins/forceOwnerCrown/index.ts b/src/plugins/forceOwnerCrown/index.ts index b21de489..907d9dc0 100644 --- a/src/plugins/forceOwnerCrown/index.ts +++ b/src/plugins/forceOwnerCrown/index.ts @@ -27,7 +27,7 @@ export default definePlugin({ authors: [Devs.D3SOX, Devs.Nickyux], patches: [ { - find: "#{intl::GUILD_OWNER}", + find: "#{intl::GUILD_OWNER}),children:", replacement: { match: /,isOwner:(\i),/, replace: ",_isOwner:$1=$self.isGuildOwner(e)," diff --git a/src/plugins/moreUserTags/index.tsx b/src/plugins/moreUserTags/index.tsx index 29d97865..8029b483 100644 --- a/src/plugins/moreUserTags/index.tsx +++ b/src/plugins/moreUserTags/index.tsx @@ -218,7 +218,7 @@ export default definePlugin({ }, // in the member list { - find: "#{intl::GUILD_OWNER}", + find: "#{intl::GUILD_OWNER}),children:", replacement: { match: /(?\i)=\(null==.{0,100}\.BOT;return null!=(?\i)&&\i\.bot/, replace: "$ = $self.getTag({user: $, channel: arguments[0].channel, origType: $.bot ? 0 : null, location: 'not-chat' }); return typeof $ === 'number'" diff --git a/src/plugins/noUnblockToJump/index.ts b/src/plugins/noUnblockToJump/index.ts index 62112926..04ddf2ed 100644 --- a/src/plugins/noUnblockToJump/index.ts +++ b/src/plugins/noUnblockToJump/index.ts @@ -55,7 +55,7 @@ export default definePlugin({ }, { // Clicking on replied messages to jump - find: "flash:!0,returnMessageId", + find: '("interactionUsernameProfile', replacement: [ { match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, diff --git a/src/plugins/reverseImageSearch/index.tsx b/src/plugins/reverseImageSearch/index.tsx index eb87240c..17fdb180 100644 --- a/src/plugins/reverseImageSearch/index.tsx +++ b/src/plugins/reverseImageSearch/index.tsx @@ -108,7 +108,7 @@ export default definePlugin({ patches: [ { - find: "#{intl::MESSAGE_ACTIONS_MENU_LABEL}", + find: "#{intl::MESSAGE_ACTIONS_MENU_LABEL}),shouldHideMediaOptions:", replacement: { match: /favoriteableType:\i,(?<=(\i)\.getAttribute\("data-type"\).+?)/, replace: (m, target) => `${m}reverseImageSearchType:${target}.getAttribute("data-role"),` diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index 7fba0131..d80691fe 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -67,7 +67,7 @@ export default definePlugin({ }, // fixes a bug where Members page must be loaded to see highest role, why is Discord depending on MemberSafetyStore.getEnhancedMember for something that can be obtained here? { - find: "#{intl::GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL}", + find: "#{intl::GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL}),allowOverflow:", predicate: () => settings.store.showModView, replacement: { match: /(role:)\i(?=,guildId.{0,100}role:(\i\[))/, @@ -76,7 +76,7 @@ export default definePlugin({ }, // allows you to open mod view on yourself { - find: ".MEMBER_SAFETY,{modViewPanel:", + find: 'action:"PRESS_MOD_VIEW",icon:', predicate: () => settings.store.showModView, replacement: { match: /\i(?=\?null)/,