From 465a87f66bcc8dd6a3841e14b4c072e20fc2eda4 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 25 Oct 2023 20:07:45 +0200 Subject: [PATCH] Fix ColorSighted --- src/plugins/colorSighted/index.ts | 5 +++-- src/webpack/patchWebpack.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/colorSighted/index.ts b/src/plugins/colorSighted/index.ts index d2fb0d65..d741aaae 100644 --- a/src/plugins/colorSighted/index.ts +++ b/src/plugins/colorSighted/index.ts @@ -34,8 +34,9 @@ export default definePlugin({ { find: ".AVATAR_STATUS_MOBILE_16;", replacement: { - match: /(\.fromIsMobile,.+?)\i.status/, - replace: (_, rest) => `${rest}"online"` + match: /(?<=fromIsMobile:\i=!0,.+?)status:(\i)/, + // Rename field to force it to always use "online" + replace: 'status_$:$1="online"' } } ] diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 395c35fe..880aa255 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -167,6 +167,7 @@ function patchPush(webpackGlobal: any) { try { const newCode = executePatch(replacement.match, replacement.replace as string); if (newCode === code && !patch.noWarn) { + (window.explosivePlugins ??= new Set()).add(patch.plugin); logger.warn(`Patch by ${patch.plugin} had no effect (Module id is ${id}): ${replacement.match}`); if (IS_DEV) { logger.debug("Function Source:\n", code);