From c1593e180646dbfa264ab8d1e1da66cc352cec77 Mon Sep 17 00:00:00 2001 From: SuperStormer <41648788+SuperStormer@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:13:27 -0400 Subject: [PATCH 1/3] Dearrow: fix ">" handling (#2582) --- src/plugins/dearrow/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/dearrow/index.tsx b/src/plugins/dearrow/index.tsx index 89199da8f..5fb438256 100644 --- a/src/plugins/dearrow/index.tsx +++ b/src/plugins/dearrow/index.tsx @@ -69,7 +69,7 @@ async function embedDidMount(this: Component) { if (hasTitle && replaceElements !== ReplaceElements.ReplaceThumbnailsOnly) { embed.dearrow.oldTitle = embed.rawTitle; - embed.rawTitle = titles[0].title.replace(/ >(\S)/g, " $1"); + embed.rawTitle = titles[0].title.replace(/(^|\s)>(\S)/g, "$1$2"); } if (hasThumb && replaceElements !== ReplaceElements.ReplaceTitlesOnly) { From 098124175fa28935824300f55cff3964aaf5ebb0 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Mon, 17 Jun 2024 23:00:25 +0200 Subject: [PATCH 2/3] Fix crashes & settings on canary --- src/plugins/_core/settings.tsx | 2 +- src/plugins/index.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 88ee05ff0..e998b8643 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -182,7 +182,7 @@ export default definePlugin({ patchedSettings: new WeakSet(), addSettings(elements: any[], element: { header?: string; settings: string[]; }, sectionTypes: SectionTypes) { - if (this.patchedSettings.has(elements) || !this.isRightSpot(element)) return; + if (this.patchedSettings.has(elements)) return; this.patchedSettings.add(elements); diff --git a/src/plugins/index.ts b/src/plugins/index.ts index 32bfe7e97..e7cfb82dc 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -42,7 +42,18 @@ const subscribedFluxEventsPlugins = new Set(); const pluginsValues = Object.values(Plugins); const settings = Settings.plugins; +const forceDisabled = new Set([ + "MessageLogger", + "ShowHiddenChannels", + "MoreUserTags", + "Decor", + "IgnoreActivities", + "NoBlockedMessages", + "BetterFolders", + "NoPendingCount" +]); export function isPluginEnabled(p: string) { + if (forceDisabled.has(p)) return false; return ( Plugins[p]?.required || Plugins[p]?.isDependency || From db6b1f5aaff37bbed0d93687f8e1be92c59b2752 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:13:57 -0300 Subject: [PATCH 3/3] Fix plugins on stable --- src/plugins/index.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/index.ts b/src/plugins/index.ts index e7cfb82dc..48c55c660 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -19,6 +19,7 @@ import { registerCommand, unregisterCommand } from "@api/Commands"; import { addContextMenuPatch, removeContextMenuPatch } from "@api/ContextMenu"; import { Settings } from "@api/Settings"; +import { onceDefined } from "@shared/onceDefined"; import { Logger } from "@utils/Logger"; import { canonicalizeFind } from "@utils/patches"; import { Patch, Plugin, ReporterTestable, StartAt } from "@utils/types"; @@ -33,7 +34,7 @@ const logger = new Logger("PluginManager", "#a6d189"); export const PMLogger = logger; export const plugins = Plugins; -export const patches = [] as Patch[]; +export let patches = [] as Patch[]; /** Whether we have subscribed to flux events of all the enabled plugins when FluxDispatcher was ready */ let enabledPluginsSubscribedFlux = false; @@ -53,7 +54,6 @@ const forceDisabled = new Set([ "NoPendingCount" ]); export function isPluginEnabled(p: string) { - if (forceDisabled.has(p)) return false; return ( Plugins[p]?.required || Plugins[p]?.isDependency || @@ -133,9 +133,17 @@ for (const p of pluginsValues) { } } +onceDefined(window, "GLOBAL_ENV", v => { + if (v.SENTRY_TAGS.buildId !== "366c746173a6ca0a801e9f4a4d7b6745e6de45d4") { + patches = patches.filter(p => !forceDisabled.has(p.plugin)); + } +}); + export const startAllPlugins = traceFunction("startAllPlugins", function startAllPlugins(target: StartAt) { logger.info(`Starting plugins (stage ${target})`); for (const name in Plugins) { + if (window.GLOBAL_ENV?.SENTRY_TAGS.buildId !== "366c746173a6ca0a801e9f4a4d7b6745e6de45d4" && forceDisabled.has(name)) continue; + if (isPluginEnabled(name) && (!IS_REPORTER || isReporterTestable(Plugins[name], ReporterTestable.Start))) { const p = Plugins[name];