diff --git a/src/plugins/_api/messagePopover.ts b/src/plugins/_api/messagePopover.ts index 5bb6dfc1f..e20cc2cf2 100644 --- a/src/plugins/_api/messagePopover.ts +++ b/src/plugins/_api/messagePopover.ts @@ -26,19 +26,26 @@ export default definePlugin({ patches: [ { find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}),children", - replacement: { - // TODO: (\i\.\i|\i) is for stable compat - match: /(?<=\]\}\)),(.{0,40}togglePopout:.+?\}\))\]\}\):null,(?<=\((\i\.\i|\i),\{label:.+?:null,(\i)\?\(0,\i\.jsxs?\)\(\i\.Fragment.+?message:(\i).+?)/, - replace: (_, ReactButton, ButtonComponent, showReactButton, message) => "" + - `]}):null,Vencord.Api.MessagePopover._buildPopoverElements(${ButtonComponent},${message}),${showReactButton}?${ReactButton}:null,` - } - }, - { - find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}", - replacement: { - match: /className:(\i\(\)\(\i\.className,.{0,80}?\)),(onClick:.{0,150}?children:\(0,\i\.jsxs?\)\(\i,\{className:)(\i\.innerClassName),children:(\[\i,\i\])/, - replace: 'className:"vc-message-popover "+$1,$2$3+" vc-message-popover-bar",children:Vencord.Api.MessagePopover._wrapPopoverBar($4)' - } + replacement: [ + { + // TODO: (\i\.\i|\i) is for stable compat + match: /(?<=\]\}\)),(.{0,40}togglePopout:.+?\}\))\]\}\):null,(?<=\((\i\.\i|\i),\{label:.+?:null,(\i)\?\(0,\i\.jsxs?\)\(\i\.Fragment.+?message:(\i).+?)/, + replace: (_, ReactButton, ButtonComponent, showReactButton, message) => "" + + `]}):null,Vencord.Api.MessagePopover._buildPopoverElements(${ButtonComponent},${message}),${showReactButton}?${ReactButton}:null,` + }, + { + match: /className:(\i\(\)\(\i\.className,)(?=.{0,200}?#{intl::MESSAGE_UTILITIES_A11Y_LABEL})/, + replace: 'className:"vc-message-popover "+$1' + }, + { + match: /(?<=#{intl::MESSAGE_UTILITIES_A11Y_LABEL}.{0,30})className:(\i\.innerClassName)/, + replace: 'className:$1+" vc-message-popover-bar"' + }, + { + match: /(?<=#{intl::MESSAGE_UTILITIES_A11Y_LABEL}.{0,100})children:(\[\i,\i\])/, + replace: "children:Vencord.Api.MessagePopover._wrapPopoverBar($1)" + } + ] }, { find: 'role:"article",onMouseEnter', diff --git a/src/plugins/showAllMessageButtons/index.ts b/src/plugins/showAllMessageButtons/index.ts index 9fca9b733..f46e37907 100644 --- a/src/plugins/showAllMessageButtons/index.ts +++ b/src/plugins/showAllMessageButtons/index.ts @@ -55,7 +55,7 @@ export default definePlugin({ }, { predicate: () => !settings.store.noQuickReacts, - match: /\i(\?null:\(0,\i\.jsxs\).{0,100}message:\i\}\)),\(0,\i\.jsxs?\)\(\i,\{\}\)/, + match: /\i(\?null:\(0,\i\.jsxs\).{0,100}message:\i\}\)),\(0,\i\.jsxs?\)\(\i\.\i,\{\}\)/, replace: "false$1" }, ]