From df44edd41ba185ab2afb437cda16c4bafd87ac7e Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:07:30 -0500 Subject: [PATCH 1/6] BetterFolders: Fix including open folders in main sidebar (#3064) --- src/plugins/betterFolders/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index 68746d361..6f9b796e8 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -159,7 +159,7 @@ export default definePlugin({ ] }, { - find: ".FOLDER_ITEM_GUILD_ICON_MARGIN);", + find: ".expandedFolderBackground,", predicate: () => settings.store.sidebar, replacement: [ // We use arguments[0] to access the isBetterFolders variable in this nested folder component (the parent exports all the props so we don't have to patch it) From a3f5dc39a09506ecbeaa3c496ba9a1a95189a2cc Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 7 Dec 2024 00:13:59 +0100 Subject: [PATCH 2/6] CallTimer: fix crashing on canary --- src/plugins/callTimer/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/callTimer/index.tsx b/src/plugins/callTimer/index.tsx index c018cc715..01b1cb987 100644 --- a/src/plugins/callTimer/index.tsx +++ b/src/plugins/callTimer/index.tsx @@ -75,10 +75,11 @@ export default definePlugin({ patches: [{ find: "renderConnectionStatus(){", replacement: { - match: /(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i/, + match: /(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i(?=\})/, replace: "[$&, $self.renderTimer(this.props.channel.id)]" } }], + renderTimer(channelId: string) { return From cea0a3c9d97bbec08241a7294c2d0c7d41225d72 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:14:49 -0300 Subject: [PATCH 3/6] NoScreensharePreview: Allow plugin to be turned on/off --- src/plugins/noScreensharePreview/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/noScreensharePreview/index.ts b/src/plugins/noScreensharePreview/index.ts index 6ad39a90f..d4bb9c1eb 100644 --- a/src/plugins/noScreensharePreview/index.ts +++ b/src/plugins/noScreensharePreview/index.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import { Settings } from "@api/Settings"; import { getUserSettingLazy } from "@api/UserSettings"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; @@ -28,11 +27,16 @@ export default definePlugin({ name: "NoScreensharePreview", description: "Disables screenshare previews from being sent.", authors: [Devs.Nuckyz], + start() { if (!DisableStreamPreviews.getSetting()) { DisableStreamPreviews.updateSetting(true); } + }, - Settings.plugins.NoScreensharePreview.enabled = false; + stop() { + if (DisableStreamPreviews.getSetting()) { + DisableStreamPreviews.updateSetting(false); + } } }); From 3a339636d138da5745322f6e317331d7d9387dc2 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:55:37 -0300 Subject: [PATCH 4/6] Remove old plugin migrations --- src/plugins/disableCallIdle/index.ts | 2 -- src/plugins/newGuildSettings/index.tsx | 4 +--- src/plugins/partyMode/index.ts | 3 +-- src/plugins/serverInfo/index.tsx | 2 -- src/plugins/showHiddenThings/index.ts | 3 +-- src/plugins/youtubeAdblock.desktop/index.ts | 2 -- 6 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/plugins/disableCallIdle/index.ts b/src/plugins/disableCallIdle/index.ts index 82ab56f2c..5a1ac84fe 100644 --- a/src/plugins/disableCallIdle/index.ts +++ b/src/plugins/disableCallIdle/index.ts @@ -16,11 +16,9 @@ * along with this program. If not, see . */ -import { migratePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; -migratePluginSettings("DisableCallIdle", "DisableDMCallIdle"); export default definePlugin({ name: "DisableCallIdle", description: "Disables automatically getting kicked from a DM voice call after 3 minutes and being moved to an AFK voice channel.", diff --git a/src/plugins/newGuildSettings/index.tsx b/src/plugins/newGuildSettings/index.tsx index 7cfb073fa..e613f7a00 100644 --- a/src/plugins/newGuildSettings/index.tsx +++ b/src/plugins/newGuildSettings/index.tsx @@ -20,7 +20,7 @@ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; -import { definePluginSettings, migratePluginSettings } from "@api/Settings"; +import { definePluginSettings } from "@api/Settings"; import { CogWheel } from "@components/Icons"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; @@ -115,8 +115,6 @@ function applyDefaultSettings(guildId: string | null) { } } - -migratePluginSettings("NewGuildSettings", "MuteNewGuild"); export default definePlugin({ name: "NewGuildSettings", description: "Automatically mute new servers and change various other settings upon joining", diff --git a/src/plugins/partyMode/index.ts b/src/plugins/partyMode/index.ts index c40f2e3c7..f7cddbf97 100644 --- a/src/plugins/partyMode/index.ts +++ b/src/plugins/partyMode/index.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { definePluginSettings, migratePluginSettings } from "@api/Settings"; +import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType, ReporterTestable } from "@utils/types"; import { FluxDispatcher } from "@webpack/common"; @@ -41,7 +41,6 @@ const settings = definePluginSettings({ }, }); -migratePluginSettings("PartyMode", "Party mode 🎉"); export default definePlugin({ name: "PartyMode", description: "Allows you to use party mode cause the party never ends ✨", diff --git a/src/plugins/serverInfo/index.tsx b/src/plugins/serverInfo/index.tsx index a6dd6edf9..2a3f3adf1 100644 --- a/src/plugins/serverInfo/index.tsx +++ b/src/plugins/serverInfo/index.tsx @@ -5,7 +5,6 @@ */ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; -import { migratePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; import { Menu } from "@webpack/common"; @@ -25,7 +24,6 @@ const Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild; ); }; -migratePluginSettings("ServerInfo", "ServerProfile"); // what was I thinking with this name lmao export default definePlugin({ name: "ServerInfo", description: "Allows you to view info about a server", diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index 30edb2470..a5cf81294 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { definePluginSettings, migratePluginSettings } from "@api/Settings"; +import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType, PluginSettingDef } from "@utils/types"; @@ -35,7 +35,6 @@ const settings = definePluginSettings({ disableDisallowedDiscoveryFilters: opt("Disable filters in Server Discovery search that hide NSFW & disallowed servers."), }); -migratePluginSettings("ShowHiddenThings", "ShowTimeouts"); export default definePlugin({ name: "ShowHiddenThings", tags: ["ShowTimeouts", "ShowInvitesPaused", "ShowModView", "DisableDiscoveryFilters"], diff --git a/src/plugins/youtubeAdblock.desktop/index.ts b/src/plugins/youtubeAdblock.desktop/index.ts index 708b908d9..48f911795 100644 --- a/src/plugins/youtubeAdblock.desktop/index.ts +++ b/src/plugins/youtubeAdblock.desktop/index.ts @@ -4,12 +4,10 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { migratePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; // The entire code of this plugin can be found in native.ts -migratePluginSettings("YoutubeAdblock", "WatchTogetherAdblock"); export default definePlugin({ name: "YoutubeAdblock", description: "Block ads in YouTube embeds and the WatchTogether activity via AdGuard", From 99dc65fe4e9c50d6eef2f62c4211e80bf0a20477 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 7 Dec 2024 20:31:08 -0300 Subject: [PATCH 5/6] Fix TypingIndicator & CallTimer --- src/plugins/callTimer/index.tsx | 2 +- src/plugins/showHiddenChannels/index.tsx | 2 +- src/plugins/typingIndicator/index.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/callTimer/index.tsx b/src/plugins/callTimer/index.tsx index 01b1cb987..e16abc4a1 100644 --- a/src/plugins/callTimer/index.tsx +++ b/src/plugins/callTimer/index.tsx @@ -75,7 +75,7 @@ export default definePlugin({ patches: [{ find: "renderConnectionStatus(){", replacement: { - match: /(?<=renderConnectionStatus\(\)\{.+\.channel,children:)\i(?=\})/, + match: /(?<=renderConnectionStatus\(\){.+\.channel,children:).+?}\):\i(?=}\))/, replace: "[$&, $self.renderTimer(this.props.channel.id)]" } }], diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 6b67aee8b..181a6bc99 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -168,7 +168,7 @@ export default definePlugin({ }, // Add the hidden eye icon if the channel is hidden { - match: /\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/, + match: /\.name,{.{0,140}\.children.+?:null(?<=,channel:(\i).+?)/, replace: (m, channel) => `${m},$self.isHiddenChannel(${channel})?$self.HiddenChannelIcon():null` }, // Make voice channels also appear as muted if they are muted diff --git a/src/plugins/typingIndicator/index.tsx b/src/plugins/typingIndicator/index.tsx index e9e343311..e6a1b3b4f 100644 --- a/src/plugins/typingIndicator/index.tsx +++ b/src/plugins/typingIndicator/index.tsx @@ -163,7 +163,7 @@ export default definePlugin({ { find: "UNREAD_IMPORTANT:", replacement: { - match: /\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/, + match: /\.name,{.{0,140}\.children.+?:null(?<=,channel:(\i).+?)/, replace: "$&,$self.TypingIndicator($1.id,$1.getGuildId())" } }, From 4a5f0838e217253174401bb5e523c234239fd748 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 7 Dec 2024 20:32:16 -0300 Subject: [PATCH 6/6] Remove workaround for Devtools theme --- src/main/patcher.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/patcher.ts b/src/main/patcher.ts index e858f3fcd..e5b87290d 100644 --- a/src/main/patcher.ts +++ b/src/main/patcher.ts @@ -17,7 +17,7 @@ */ import { onceDefined } from "@shared/onceDefined"; -import electron, { app, BrowserWindowConstructorOptions, Menu, nativeTheme } from "electron"; +import electron, { app, BrowserWindowConstructorOptions, Menu } from "electron"; import { dirname, join } from "path"; import { initIpc } from "./ipcMain"; @@ -100,19 +100,6 @@ if (!IS_VANILLA) { super(options); initIpc(this); - - // Workaround for https://github.com/electron/electron/issues/43367. Vesktop also has its own workaround - // @TODO: Remove this when the issue is fixed - if (IS_DISCORD_DESKTOP) { - this.webContents.on("devtools-opened", () => { - if (!nativeTheme.shouldUseDarkColors) return; - - nativeTheme.themeSource = "light"; - setTimeout(() => { - nativeTheme.themeSource = "dark"; - }, 100); - }); - } } else super(options); } }