From 36327ebd70eadddda03be9b7b36b182e79ae7dde Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:55:28 -0300 Subject: [PATCH 1/5] PronounDB: Fix patch --- src/plugins/pronoundb/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts index 61edd191..b14b2657 100644 --- a/src/plugins/pronoundb/index.ts +++ b/src/plugins/pronoundb/index.ts @@ -56,7 +56,7 @@ export default definePlugin({ find: ".pronouns,children", replacement: [ { - match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/, + match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i.*?;(?=return)/, replace: "$&let vcPronounSource;[$2,vcPronounSource]=$self.useProfilePronouns($1.id);" }, PRONOUN_TOOLTIP_PATCH From c10466f607d889c06afdee46f7af31b1062e78b5 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:30:52 -0300 Subject: [PATCH 2/5] MoreUserTags: Fix patches --- src/plugins/moreUserTags/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/moreUserTags/index.tsx b/src/plugins/moreUserTags/index.tsx index d1ad941b..4ac54221 100644 --- a/src/plugins/moreUserTags/index.tsx +++ b/src/plugins/moreUserTags/index.tsx @@ -198,7 +198,8 @@ export default definePlugin({ replacement: [ // make the tag show the right text { - match: /(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=.{0,40}(\i\.\i\.Messages)\.BOT_TAG_BOT/, + // FIXME: Remove the BOT_TAG_BOT variant when the change arrives in stable + match: /(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=.{0,40}(\i\.\i\.Messages)\.(?:APP_TAG|BOT_TAG_BOT)/, replace: (_, origSwitch, variant, tags, displayedText, strings) => `${origSwitch}default:{${displayedText} = $self.getTagText(${tags}[${variant}], ${strings})}` }, @@ -321,19 +322,20 @@ export default definePlugin({ isOPTag: (tag: number) => tag === Tag.Types.ORIGINAL_POSTER || tags.some(t => tag === Tag.Types[`${t.name}-OP`]), + // FIXME: Remove the BOT_TAG_BOT variants from strings when the change arrives in stable getTagText(passedTagName: string, strings: Record) { - if (!passedTagName) return strings.BOT_TAG_BOT; + if (!passedTagName) return strings.APP_TAG ?? strings.BOT_TAG_BOT; const [tagName, variant] = passedTagName.split("-"); const tag = tags.find(({ name }) => tagName === name); - if (!tag) return strings.BOT_TAG_BOT; - if (variant === "BOT" && tagName !== "WEBHOOK" && this.settings.store.dontShowForBots) return strings.BOT_TAG_BOT; + if (!tag) return strings.APP_TAG ?? strings.BOT_TAG_BOT; + if (variant === "BOT" && tagName !== "WEBHOOK" && this.settings.store.dontShowForBots) return strings.APP_TAG ?? strings.BOT_TAG_BOT; const tagText = settings.store.tagSettings?.[tag.name]?.text || tag.displayName; switch (variant) { case "OP": return `${strings.BOT_TAG_FORUM_ORIGINAL_POSTER} • ${tagText}`; case "BOT": - return `${strings.BOT_TAG_BOT} • ${tagText}`; + return `${strings.APP_TAG ?? strings.BOT_TAG_BOT} • ${tagText}`; default: return tagText; } From fafd46d2028e702d7341e1eb404c68fede49bdd3 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:31:22 -0300 Subject: [PATCH 3/5] FriendsSince: Remove workaround for stable compatibility --- src/plugins/friendsSince/index.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index 69d8e739..d6b7d107 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -7,22 +7,12 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import { getCurrentChannel } from "@utils/discord"; -import { makeLazy } from "@utils/lazy"; import definePlugin from "@utils/types"; -import { filters, find, findByPropsLazy, handleModuleNotFound } from "@webpack"; +import { findByPropsLazy } from "@webpack"; import { React, RelationshipStore } from "@webpack/common"; const { Heading, Text } = findByPropsLazy("Heading", "Text"); -// Workaround for module differing on stable & canary -// FIXME: remove once merged into stable -const getMemberSinceContainer = makeLazy(() => { - for (const name of ["memberSinceWrapper", "memberSinceContainer"]) { - const mod = find(filters.byProps(name), { isIndirect: true }); - if (mod) return mod[name]; - } - handleModuleNotFound("findByProps", "memberSinceWrapper/memberSinceContainer"); - return ""; -}); +const container = findByPropsLazy("memberSinceWrapper"); const { getCreatedAtDate } = findByPropsLazy("getCreatedAtDate"); const clydeMoreInfo = findByPropsLazy("clydeMoreInfo"); const locale = findByPropsLazy("getLocale"); @@ -59,7 +49,7 @@ export default definePlugin({ Friends Since -
+
{!!getCurrentChannel()?.guild_id && (