From e2ca547b2eaf131e036647439d6a382ff1900376 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:08:42 -0500 Subject: [PATCH 01/17] Restrict DisableAnimations --- .../disableAnimations/{index.ts => index.tsx} | 48 +++++++++++-------- .../disableAnimations/styles.css | 12 +++++ .../neverPausePreviews/index.tsx | 2 +- 3 files changed, 42 insertions(+), 20 deletions(-) rename src/equicordplugins/disableAnimations/{index.ts => index.tsx} (51%) create mode 100644 src/equicordplugins/disableAnimations/styles.css diff --git a/src/equicordplugins/disableAnimations/index.ts b/src/equicordplugins/disableAnimations/index.tsx similarity index 51% rename from src/equicordplugins/disableAnimations/index.ts rename to src/equicordplugins/disableAnimations/index.tsx index 865e9cf0..dcaea0cd 100644 --- a/src/equicordplugins/disableAnimations/index.ts +++ b/src/equicordplugins/disableAnimations/index.tsx @@ -19,35 +19,45 @@ import { EquicordDevs } from "@utils/constants"; import definePlugin from "@utils/types"; import { findAll } from "@webpack"; +import { Forms } from "@webpack/common"; export default definePlugin({ name: "DisableAnimations", description: "Disables most of Discord's animations.", authors: [EquicordDevs.seth], + settingsAboutComponent: () => <> + + This plugin will only work on Equibop Vesktop and Discord Desktop + + , start() { - this.springs = findAll((mod) => { - if (!mod.Globals) return false; - return true; - }); - - for (const spring of this.springs) { - spring.Globals.assign({ - skipAnimation: true, + if (IS_EQUIBOP || IS_VESKTOP || IS_DISCORD_DESKTOP) { + this.springs = findAll(mod => { + if (!mod.Globals) return false; + return true; }); + + for (const spring of this.springs) { + spring.Globals.assign({ + skipAnimation: true, + }); + } + + this.css = document.createElement("style"); + this.css.innerText = "* { transition: none !important; animation: none !important; }"; + + document.head.appendChild(this.css); } - - this.css = document.createElement("style"); - this.css.innerText = "* { transition: none !important; animation: none !important; }"; - - document.head.appendChild(this.css); }, stop() { - for (const spring of this.springs) { - spring.Globals.assign({ - skipAnimation: false, - }); - } + if (IS_EQUIBOP || IS_VESKTOP || IS_DISCORD_DESKTOP) { + for (const spring of this.springs) { + spring.Globals.assign({ + skipAnimation: false, + }); + } - if (this.css) this.css.remove(); + if (this.css) this.css.remove(); + } } }); diff --git a/src/equicordplugins/disableAnimations/styles.css b/src/equicordplugins/disableAnimations/styles.css new file mode 100644 index 00000000..1696ac63 --- /dev/null +++ b/src/equicordplugins/disableAnimations/styles.css @@ -0,0 +1,12 @@ +.platform-warning { + font-size: 16px !important; + background-color: rgb(240 71 71 / 10%); + color: rgb(240 71 71) !important; + border: 1px solid rgb(240 71 71 / 60%) !important; + border-radius: 5px !important; + font-weight: 500; + padding: 6px 10px; + text-align: center; + margin-top: 10px; + font-style: bold; +} diff --git a/src/equicordplugins/neverPausePreviews/index.tsx b/src/equicordplugins/neverPausePreviews/index.tsx index bd9481ea..160bbf57 100644 --- a/src/equicordplugins/neverPausePreviews/index.tsx +++ b/src/equicordplugins/neverPausePreviews/index.tsx @@ -28,7 +28,7 @@ export default definePlugin({ authors: [EquicordDevs.vappstar], settingsAboutComponent: () => <> - This plugin will cause discord to use more resources than normal. + This plugin will cause discord to use more resources than normal , patches: [ From 5a01fde437b9e55243fdd9a0c4507fc61ee49dc8 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:19:33 -0500 Subject: [PATCH 02/17] Properly Restrict --- .../index.ts} | 48 ++++++++----------- .../disableAnimations/styles.css | 12 ----- 2 files changed, 19 insertions(+), 41 deletions(-) rename src/equicordplugins/{disableAnimations/index.tsx => disableAnimations.desktop/index.ts} (51%) delete mode 100644 src/equicordplugins/disableAnimations/styles.css diff --git a/src/equicordplugins/disableAnimations/index.tsx b/src/equicordplugins/disableAnimations.desktop/index.ts similarity index 51% rename from src/equicordplugins/disableAnimations/index.tsx rename to src/equicordplugins/disableAnimations.desktop/index.ts index dcaea0cd..65a754b6 100644 --- a/src/equicordplugins/disableAnimations/index.tsx +++ b/src/equicordplugins/disableAnimations.desktop/index.ts @@ -19,45 +19,35 @@ import { EquicordDevs } from "@utils/constants"; import definePlugin from "@utils/types"; import { findAll } from "@webpack"; -import { Forms } from "@webpack/common"; export default definePlugin({ name: "DisableAnimations", description: "Disables most of Discord's animations.", authors: [EquicordDevs.seth], - settingsAboutComponent: () => <> - - This plugin will only work on Equibop Vesktop and Discord Desktop - - , start() { - if (IS_EQUIBOP || IS_VESKTOP || IS_DISCORD_DESKTOP) { - this.springs = findAll(mod => { - if (!mod.Globals) return false; - return true; + this.springs = findAll(mod => { + if (!mod.Globals) return false; + return true; + }); + + for (const spring of this.springs) { + spring.Globals.assign({ + skipAnimation: true, }); - - for (const spring of this.springs) { - spring.Globals.assign({ - skipAnimation: true, - }); - } - - this.css = document.createElement("style"); - this.css.innerText = "* { transition: none !important; animation: none !important; }"; - - document.head.appendChild(this.css); } + + this.css = document.createElement("style"); + this.css.innerText = "* { transition: none !important; animation: none !important; }"; + + document.head.appendChild(this.css); }, stop() { - if (IS_EQUIBOP || IS_VESKTOP || IS_DISCORD_DESKTOP) { - for (const spring of this.springs) { - spring.Globals.assign({ - skipAnimation: false, - }); - } - - if (this.css) this.css.remove(); + for (const spring of this.springs) { + spring.Globals.assign({ + skipAnimation: false, + }); } + + if (this.css) this.css.remove(); } }); diff --git a/src/equicordplugins/disableAnimations/styles.css b/src/equicordplugins/disableAnimations/styles.css deleted file mode 100644 index 1696ac63..00000000 --- a/src/equicordplugins/disableAnimations/styles.css +++ /dev/null @@ -1,12 +0,0 @@ -.platform-warning { - font-size: 16px !important; - background-color: rgb(240 71 71 / 10%); - color: rgb(240 71 71) !important; - border: 1px solid rgb(240 71 71 / 60%) !important; - border-radius: 5px !important; - font-weight: 500; - padding: 6px 10px; - text-align: center; - margin-top: 10px; - font-style: bold; -} From 341d04b643929fcb893a2d57c073cc03d3044b1d Mon Sep 17 00:00:00 2001 From: Justin <68541335+TheAyes@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:01:36 +0100 Subject: [PATCH 03/17] [feat] Add an option to disable the glide plugin theme system (#113) * Feat: Added an option to disable all recoloring * Fixes --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> --- src/equicordplugins/glide/index.tsx | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/equicordplugins/glide/index.tsx b/src/equicordplugins/glide/index.tsx index 6b31fee8..34ac52be 100644 --- a/src/equicordplugins/glide/index.tsx +++ b/src/equicordplugins/glide/index.tsx @@ -142,6 +142,11 @@ const settings = definePluginSettings({ default: "0.2", onChange: injectCSS }, + colorsEnabled: { + type: OptionType.BOOLEAN, + description: "Whether or not to enable theming", + onChange: () => injectCSS() + }, ColorPreset: { type: OptionType.SELECT, description: "Some pre-made color presets (more soon hopefully)", @@ -318,13 +323,15 @@ function getCSS(fontName) { { --animspeed: ${Settings.plugins.Glide.animationSpeed + "s"}; --font-primary: ${(fontName.length > 0 ? fontName : "Nunito")}; - --accent: #${Settings.plugins.Glide.Accent}; - --bgcol: #${Settings.plugins.Glide.Primary}; - --text: #${Settings.plugins.Glide.Text}; - --brand: #${Settings.plugins.Glide.Brand}; - --mutedtext: ${mute(Settings.plugins.Glide.Text, 20)}; - --mutedbrand: ${mute(Settings.plugins.Glide.Brand, 10)}; - --mutedaccent: ${mute(Settings.plugins.Glide.Accent, 10)}; + ${Settings.plugins.Glide.colorsEnabled ? ` + --accent: #${Settings.plugins.Glide.Accent}; + --bgcol: #${Settings.plugins.Glide.Primary}; + --text: #${Settings.plugins.Glide.Text}; + --brand: #${Settings.plugins.Glide.Brand}; + --mutedtext: ${mute(Settings.plugins.Glide.Text, 20)}; + --mutedbrand: ${mute(Settings.plugins.Glide.Brand, 10)}; + --mutedaccent: ${mute(Settings.plugins.Glide.Accent, 10)}; + ` : ""} } :root { @@ -341,7 +348,7 @@ function getCSS(fontName) { /*COLOR ASSIGNING (most of these probably effect more than whats commented)*/ - + ${Settings.plugins.Glide.colorsEnabled ? ` /*accent based*/ /*buttons*/ @@ -546,7 +553,7 @@ function getCSS(fontName) { .unread_d8bfb3 { background-color: var(--text) !important; - } + }` : ""} /*ROUNDING (rounding)*/ @@ -642,7 +649,7 @@ function getCSS(fontName) { } /*Hide icon on file uploading status*/ - .icon_b52bef + .icon_f46c86 { display: none; } From 70f5dba4568c583c3cb10f457cc15107ad9e10ee Mon Sep 17 00:00:00 2001 From: Justin <68541335+TheAyes@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:02:14 +0100 Subject: [PATCH 04/17] Refac: Clarified Transparency warning message (#114) --- src/components/VencordSettings/VencordTab.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx index deabef4a..55ff94ab 100644 --- a/src/components/VencordSettings/VencordTab.tsx +++ b/src/components/VencordSettings/VencordTab.tsx @@ -109,8 +109,8 @@ function EquicordSettings() { title: "Enable window transparency.", note: "You need a theme that supports transparency or this will do nothing. Requires a full restart!", warning: { - enabled: true, - message: "This will stop the window from being resizable.", + enabled: isWindows, + message: "Enabling this will prevent you from snapping this window.", }, }, !IS_WEB && From 0a0d817d1e7ac5dec0d353f64a2d94972933fc3b Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 19 Dec 2024 21:16:25 -0500 Subject: [PATCH 05/17] injectcss if glide is enabled --- src/equicordplugins/glide/index.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/equicordplugins/glide/index.tsx b/src/equicordplugins/glide/index.tsx index 34ac52be..2007c730 100644 --- a/src/equicordplugins/glide/index.tsx +++ b/src/equicordplugins/glide/index.tsx @@ -243,18 +243,20 @@ function parseFontContent() { return fontName; } function injectCSS() { + if (Settings.plugins.Glide.enabled) { - const fontName = parseFontContent(); - const theCSS = getCSS(fontName); + const fontName = parseFontContent(); + const theCSS = getCSS(fontName); - var elementToRemove = document.getElementById("GlideStyleInjection"); - if (elementToRemove) { - elementToRemove.remove(); + let elementToRemove = document.getElementById("GlideStyleInjection"); + if (elementToRemove) { + elementToRemove.remove(); + } + const styleElement = document.createElement("style"); + styleElement.id = "GlideStyleInjection"; + styleElement.textContent = theCSS; + document.documentElement.appendChild(styleElement); } - const styleElement = document.createElement("style"); - styleElement.id = "GlideStyleInjection"; - styleElement.textContent = theCSS; - document.documentElement.appendChild(styleElement); } function getCSS(fontName) { @@ -528,7 +530,7 @@ function getCSS(fontName) { background-color: var(--primary); } ${settings.store.pastelStatuses ? - ` + ` /*Pastel statuses*/ rect[fill='#23a55a'], svg[fill='#23a55a'] { fill: #80c968 !important; From 9ccc74bde37ceb30017d434907b12f0e0f19c9d1 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 20 Dec 2024 15:06:19 +0100 Subject: [PATCH 06/17] use correct prodversion in chrome extension installer --- src/main/utils/extensions.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/utils/extensions.ts b/src/main/utils/extensions.ts index d8f84377..8a211baf 100644 --- a/src/main/utils/extensions.ts +++ b/src/main/utils/extensions.ts @@ -71,13 +71,16 @@ export async function installExt(id: string) { // React Devtools v4.25 // v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843 // Unfortunately, Google does not serve old versions, so this is the only way + // This zip file is pinned to long commit hash so it cannot be changed remotely ? "https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip" - : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=32`; + : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=${process.versions.chrome}`; + const buf = await get(url, { headers: { - "User-Agent": "Vencord (https://github.com/Vendicated/Vencord)" + "User-Agent": `Electron ${process.versions.electron} ~ Vencord (https://github.com/Vendicated/Vencord)` } }); + await extract(crxToZip(buf), extDir).catch(console.error); } From abec516c9c0a25d75f14e76dfa8e03bd1d1dac5e Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:20:01 -0500 Subject: [PATCH 07/17] HideScreenShare --- README.md | 3 +- src/equicordplugins/glide/index.tsx | 2 +- src/equicordplugins/hideScreenShare/index.ts | 35 ++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/equicordplugins/hideScreenShare/index.ts diff --git a/README.md b/README.md index 792f9434..38347364 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch ### Extra included plugins
-151 additional plugins +152 additional plugins ### All Platforms - AllCallTimers by MaxHerbold & D3SOX @@ -70,6 +70,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - GrammarFix by S€th - HideChatButtons by iamme - HideMessage by Hanzy +- HideScreenShare by thororen - HideServers by bepvte - HolyNotes by Wolfie - HomeTyping by Samwich diff --git a/src/equicordplugins/glide/index.tsx b/src/equicordplugins/glide/index.tsx index 2007c730..0201e091 100644 --- a/src/equicordplugins/glide/index.tsx +++ b/src/equicordplugins/glide/index.tsx @@ -248,7 +248,7 @@ function injectCSS() { const fontName = parseFontContent(); const theCSS = getCSS(fontName); - let elementToRemove = document.getElementById("GlideStyleInjection"); + const elementToRemove = document.getElementById("GlideStyleInjection"); if (elementToRemove) { elementToRemove.remove(); } diff --git a/src/equicordplugins/hideScreenShare/index.ts b/src/equicordplugins/hideScreenShare/index.ts new file mode 100644 index 00000000..962ee0e4 --- /dev/null +++ b/src/equicordplugins/hideScreenShare/index.ts @@ -0,0 +1,35 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2022 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +import { EquicordDevs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "HideScreenShare", + description: "Hide your screen share by default", + authors: [EquicordDevs.thororen], + patches: [ + { + find: '"self-stream-hide"', + replacement: { + match: /return \i?(.*?onConfirm:\(\)=>(\i\(!\i\)))/, + replace: "return $2$1" + } + } + ], +}); From 30f2a022fea282fd6c04d69b39ed0e7f9385d484 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:36:37 -0500 Subject: [PATCH 08/17] Fix H being undefined --- src/equicordplugins/hideScreenShare/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/equicordplugins/hideScreenShare/index.ts b/src/equicordplugins/hideScreenShare/index.ts index 962ee0e4..51c63790 100644 --- a/src/equicordplugins/hideScreenShare/index.ts +++ b/src/equicordplugins/hideScreenShare/index.ts @@ -27,8 +27,8 @@ export default definePlugin({ { find: '"self-stream-hide"', replacement: { - match: /return \i?(.*?onConfirm:\(\)=>(\i\(!\i\)))/, - replace: "return $2$1" + match: /return (\i)?(.*?onConfirm:\(\)=>((\i)\(!\i\)))/, + replace: "let $4 = null; if ($4 !== null) return $3; return $1$2" } } ], From cca5d7dc0991c5f229cbab5efaddf89cfaae7b4d Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 21 Dec 2024 20:55:24 -0300 Subject: [PATCH 09/17] ShowHiddenThings: Discovery filter bypass is patched Filtering is now done server-side in Discord --- src/plugins/showHiddenThings/index.ts | 45 +++------------------------ 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index a5cf8129..6ee131a8 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -30,9 +30,7 @@ const opt = (description: string) => ({ const settings = definePluginSettings({ showTimeouts: opt("Show member timeout icons in chat."), showInvitesPaused: opt("Show the invites paused tooltip in the server list."), - showModView: opt("Show the member mod view context menu item in all servers."), - disableDiscoveryFilters: opt("Disable filters in Server Discovery search that hide servers that don't meet discovery criteria."), - disableDisallowedDiscoveryFilters: opt("Disable filters in Server Discovery search that hide NSFW & disallowed servers."), + showModView: opt("Show the member mod view context menu item in all servers.") }); export default definePlugin({ @@ -40,6 +38,8 @@ export default definePlugin({ tags: ["ShowTimeouts", "ShowInvitesPaused", "ShowModView", "DisableDiscoveryFilters"], description: "Displays various hidden & moderator-only things regardless of permissions.", authors: [Devs.Dolfies], + settings, + patches: [ { find: "showCommunicationDisabledStyles", @@ -82,43 +82,6 @@ export default definePlugin({ match: /\i(?=\?null)/, replace: "false" } - }, - { - find: "prod_discoverable_guilds", - predicate: () => settings.store.disableDiscoveryFilters, - replacement: { - match: /\{"auto_removed:.*?\}/, - replace: "{}" - } - }, - // remove the 200 server minimum - { - find: '">200"', - predicate: () => settings.store.disableDiscoveryFilters, - replacement: { - match: '">200"', - replace: '">0"' - } - }, - // empty word filter - { - find: '"pepe","nude"', - predicate: () => settings.store.disableDisallowedDiscoveryFilters, - replacement: { - match: /(?<=[?=])\["pepe",.+?\]/, - replace: "[]", - }, - }, - // patch request that queries if term is allowed - { - find: ".GUILD_DISCOVERY_VALID_TERM,query:", - predicate: () => settings.store.disableDisallowedDiscoveryFilters, - all: true, - replacement: { - match: /\i\.\i\.get\(\{url:\i\.\i\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0,rejectWithError:!1\}\)/g, - replace: "Promise.resolve({ body: { valid: true } })" - } } - ], - settings, + ] }); From 7c5af82621db4e23d37ae7e73dceb79ac1d34753 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:27:49 -0500 Subject: [PATCH 10/17] Drop HideScreenShare Temporarily --- README.md | 3 +- src/equicordplugins/hideScreenShare/index.ts | 35 -------------------- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 src/equicordplugins/hideScreenShare/index.ts diff --git a/README.md b/README.md index 38347364..792f9434 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch ### Extra included plugins
-152 additional plugins +151 additional plugins ### All Platforms - AllCallTimers by MaxHerbold & D3SOX @@ -70,7 +70,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - GrammarFix by S€th - HideChatButtons by iamme - HideMessage by Hanzy -- HideScreenShare by thororen - HideServers by bepvte - HolyNotes by Wolfie - HomeTyping by Samwich diff --git a/src/equicordplugins/hideScreenShare/index.ts b/src/equicordplugins/hideScreenShare/index.ts deleted file mode 100644 index 51c63790..00000000 --- a/src/equicordplugins/hideScreenShare/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -import { EquicordDevs } from "@utils/constants"; -import definePlugin from "@utils/types"; - -export default definePlugin({ - name: "HideScreenShare", - description: "Hide your screen share by default", - authors: [EquicordDevs.thororen], - patches: [ - { - find: '"self-stream-hide"', - replacement: { - match: /return (\i)?(.*?onConfirm:\(\)=>((\i)\(!\i\)))/, - replace: "let $4 = null; if ($4 !== null) return $3; return $1$2" - } - } - ], -}); From cc4266cbf229fc6613e3e4242f8bcc8870881f77 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 28 Dec 2024 21:22:29 -0500 Subject: [PATCH 11/17] Fix StatusPresets --- src/equicordplugins/statusPresets/index.tsx | 13 ++++++++++--- src/plugins/fakeNitro/index.tsx | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/equicordplugins/statusPresets/index.tsx b/src/equicordplugins/statusPresets/index.tsx index aac9b577..c0ab1fab 100644 --- a/src/equicordplugins/statusPresets/index.tsx +++ b/src/equicordplugins/statusPresets/index.tsx @@ -18,7 +18,7 @@ import "./style.css"; -import { definePluginSettings } from "@api/Settings"; +import { definePluginSettings, Settings } from "@api/Settings"; import { getUserSettingLazy } from "@api/UserSettings"; import ErrorBoundary from "@components/ErrorBoundary"; import { EquicordDevs } from "@utils/constants"; @@ -123,16 +123,23 @@ const RenderStatusMenuItem = ({ status, update, disabled }: { status: DiscordSta const StatusSubMenuComponent = () => { + let premiumType; + if (Settings.plugins.NoNitroUpsell.enabled) { + // @ts-ignore + premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0; + } else { + premiumType = UserStore?.getCurrentUser()?.premiumType ?? 0; + } const update = useForceUpdater(); return { }}> {Object.entries((settings.store.StatusPresets as { [k: string]: DiscordStatus | undefined; })).map(([index, status]) => status != null ? (status.emojiInfo?.id != null && UserStore.getCurrentUser().hasPremiumPerks || status.emojiInfo?.id == null) && setStatus(status)} + action={() => (status.emojiInfo?.id != null && premiumType > 0 || status.emojiInfo?.id == null) && setStatus(status)} render={() => } /> : null)} ; diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 6e13ce5a..ffce2428 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -31,7 +31,7 @@ import { applyPalette, GIFEncoder, quantize } from "gifenc"; import type { ReactElement, ReactNode } from "react"; let premiumType; -if (Settings.plugins?.NoNitroUpsell?.enabled) { +if (Settings.plugins.NoNitroUpsell.enabled) { // @ts-ignore premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0; } else { From 79e2cb15f1e680fe9a1c7aeb33080fd09d41a85f Mon Sep 17 00:00:00 2001 From: Sqaaakoi Date: Mon, 30 Dec 2024 15:22:10 +1300 Subject: [PATCH 12/17] QuickReply: Prevent caret from moving when selecting message (#3104) --- src/plugins/quickReply/index.ts | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/plugins/quickReply/index.ts b/src/plugins/quickReply/index.ts index ac2a3870..4a7060c5 100644 --- a/src/plugins/quickReply/index.ts +++ b/src/plugins/quickReply/index.ts @@ -20,7 +20,7 @@ import { definePluginSettings, Settings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { findByPropsLazy } from "@webpack"; -import { ChannelStore, FluxDispatcher as Dispatcher, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from "@webpack/common"; +import { ChannelStore, ComponentDispatch, FluxDispatcher as Dispatcher, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from "@webpack/common"; import { Message } from "discord-types/general"; const Kangaroo = findByPropsLazy("jumpToMessage"); @@ -60,24 +60,24 @@ export default definePlugin({ settings, start() { - Dispatcher.subscribe("DELETE_PENDING_REPLY", onDeletePendingReply); - Dispatcher.subscribe("MESSAGE_END_EDIT", onEndEdit); - Dispatcher.subscribe("MESSAGE_START_EDIT", onStartEdit); - Dispatcher.subscribe("CREATE_PENDING_REPLY", onCreatePendingReply); document.addEventListener("keydown", onKeydown); }, stop() { - Dispatcher.unsubscribe("DELETE_PENDING_REPLY", onDeletePendingReply); - Dispatcher.unsubscribe("MESSAGE_END_EDIT", onEndEdit); - Dispatcher.unsubscribe("MESSAGE_START_EDIT", onStartEdit); - Dispatcher.unsubscribe("CREATE_PENDING_REPLY", onCreatePendingReply); document.removeEventListener("keydown", onKeydown); }, -}); -const onDeletePendingReply = () => replyIdx = -1; -const onEndEdit = () => editIdx = -1; + flux: { + DELETE_PENDING_REPLY() { + replyIdx = -1; + }, + MESSAGE_END_EDIT() { + editIdx = -1; + }, + MESSAGE_START_EDIT: onStartEdit, + CREATE_PENDING_REPLY: onCreatePendingReply + } +}); function calculateIdx(messages: Message[], id: string) { const idx = messages.findIndex(m => m.id === id); @@ -109,6 +109,8 @@ function onKeydown(e: KeyboardEvent) { if (!isUp && e.key !== "ArrowDown") return; if (!isCtrl(e) || isAltOrMeta(e)) return; + e.preventDefault(); + if (e.shiftKey) nextEdit(isUp); else @@ -194,9 +196,10 @@ function nextReply(isUp: boolean) { channel, message, shouldMention: shouldMention(message), - showMentionToggle: channel.guild_id !== null && message.author.id !== meId, + showMentionToggle: channel.isPrivate() && message.author.id !== meId, _isQuickReply: true }); + ComponentDispatch.dispatchToLastSubscribed("TEXTAREA_FOCUS"); jumpIfOffScreen(channel.id, message.id); } From 0e813e78d0c55d06f5062312d4aea3db01d0cc97 Mon Sep 17 00:00:00 2001 From: fae <752642+faejr@users.noreply.github.com> Date: Mon, 30 Dec 2024 03:24:29 +0100 Subject: [PATCH 13/17] OpenInApp: Add support for geo.music.apple.com links (#3101) --- src/plugins/openInApp/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index 2d27c2b2..09fc2f3b 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -57,7 +57,7 @@ const UrlReplacementRules: Record = { description: "Open Tidal links in the Tidal app", }, itunes: { - match: /^https:\/\/music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/, + match: /^https:\/\/(?:geo\.)?music\.apple\.com\/([a-z]{2}\/)?(album|artist|playlist|song|curator)\/([^/?#]+)\/?([^/?#]+)?(?:\?.*)?(?:#.*)?$/, replace: (_, lang, type, name, id) => id ? `itunes://music.apple.com/us/${type}/${name}/${id}` : `itunes://music.apple.com/us/${type}/${name}`, description: "Open Apple Music links in the iTunes app" }, From 0fd76ab15a51a8426786b696d422f59bd1250099 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Sun, 29 Dec 2024 21:28:22 -0500 Subject: [PATCH 14/17] NoUnblockToJump: Also allow jump for ignored users (#3110) --- src/plugins/noUnblockToJump/README.md | 5 +++ src/plugins/noUnblockToJump/index.ts | 45 ++++++++++++++++++++------- 2 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 src/plugins/noUnblockToJump/README.md diff --git a/src/plugins/noUnblockToJump/README.md b/src/plugins/noUnblockToJump/README.md new file mode 100644 index 00000000..326bca3b --- /dev/null +++ b/src/plugins/noUnblockToJump/README.md @@ -0,0 +1,5 @@ +# No Unblock To Jump + +Removes the popup preventing you to jump to a message from a blocked/ignored user (eg: in search results) + +![A modal popup telling you to unblock a user to jump their message](https://github.com/user-attachments/assets/0e4b859d-f3b3-4101-9a83-829afb473d1e) diff --git a/src/plugins/noUnblockToJump/index.ts b/src/plugins/noUnblockToJump/index.ts index cde0e19e..62112926 100644 --- a/src/plugins/noUnblockToJump/index.ts +++ b/src/plugins/noUnblockToJump/index.ts @@ -26,25 +26,46 @@ export default definePlugin({ authors: [Devs.dzshn], patches: [ { + // Clicking on search results to jump find: '.id,"Search Results"', - replacement: { - match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, - replace: "if(false)$1" - } + replacement: [ + { + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, + replace: "if(false)$1" + }, + { + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNIGNORE_TO_JUMP_TITLE})/, + replace: "if(false)$1" + }, + ] }, { + // Jump buttton in top right corner of messages find: "renderJumpButton()", - replacement: { - match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, - replace: "if(false)$1" - } + replacement: [ + { + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, + replace: "if(false)$1" + }, + { + match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNIGNORE_TO_JUMP_TITLE})/, + replace: "if(false)$1" + }, + ] }, { + // Clicking on replied messages to jump find: "flash:!0,returnMessageId", - replacement: { - match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, - replace: "false?$1" - } + replacement: [ + { + match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/, + replace: "false?$1" + }, + { + match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNIGNORE_TO_JUMP_TITLE})/, + replace: "false?$1" + }, + ] } ] }); From 20ed7dc96b1ae687dff21c56481548d50a63396a Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Mon, 30 Dec 2024 00:07:26 -0500 Subject: [PATCH 15/17] new plugin FullUserInChatbox (#2766) --- src/components/ErrorBoundary.tsx | 3 +- .../accountPanelServerProfile/index.tsx | 2 +- src/plugins/fullUserInChatbox/README.md | 9 ++++ src/plugins/fullUserInChatbox/index.tsx | 47 +++++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/plugins/fullUserInChatbox/README.md create mode 100644 src/plugins/fullUserInChatbox/index.tsx diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index ea2e02b5..320d4096 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -27,7 +27,7 @@ interface Props { /** Render nothing if an error occurs */ noop?: boolean; /** Fallback component to render if an error occurs */ - fallback?: React.ComponentType>; + fallback?: React.ComponentType>; /** called when an error occurs. The props property is only available if using .wrap */ onError?(data: { error: Error, errorInfo: React.ErrorInfo, props: T; }): void; /** Custom error message */ @@ -81,6 +81,7 @@ const ErrorBoundary = LazyComponent(() => { if (this.props.fallback) return ; diff --git a/src/plugins/accountPanelServerProfile/index.tsx b/src/plugins/accountPanelServerProfile/index.tsx index fcecffb1..1b468a6d 100644 --- a/src/plugins/accountPanelServerProfile/index.tsx +++ b/src/plugins/accountPanelServerProfile/index.tsx @@ -85,7 +85,7 @@ export default definePlugin({ replace: "$&onRequestClose:$self.onPopoutClose," }, { - match: /(?<=.avatarWrapper,)/, + match: /(?<=\.avatarWrapper,)/, replace: "ref:$self.accountPanelRef,onContextMenu:$self.openAccountPanelContextMenu," } ] diff --git a/src/plugins/fullUserInChatbox/README.md b/src/plugins/fullUserInChatbox/README.md new file mode 100644 index 00000000..2401f589 --- /dev/null +++ b/src/plugins/fullUserInChatbox/README.md @@ -0,0 +1,9 @@ +# Full User In Chatbox + +Adds the full user mention to the textbox + +Adds the avatar if you have mentioned avatars enabled + +Provides the full context menu to make it easy to access the users profile, and other common actions + +https://github.com/user-attachments/assets/cd9edb33-99c8-4c8d-b669-8cddd05f4b45 diff --git a/src/plugins/fullUserInChatbox/index.tsx b/src/plugins/fullUserInChatbox/index.tsx new file mode 100644 index 00000000..792f0419 --- /dev/null +++ b/src/plugins/fullUserInChatbox/index.tsx @@ -0,0 +1,47 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import ErrorBoundary from "@components/ErrorBoundary"; +import { Devs } from "@utils/constants"; +import definePlugin from "@utils/types"; +import { findComponentByCodeLazy } from "@webpack"; +import { ReactNode } from "react"; + +const UserMentionComponent = findComponentByCodeLazy(".USER_MENTION)"); + +interface UserMentionComponentProps { + id: string; + channelId: string; + guildId: string; + OriginalComponent: ReactNode; +} + +export default definePlugin({ + name: "FullUserInChatbox", + description: "Makes the user mention in the chatbox have more functionalities, like left/right clicking", + authors: [Devs.sadan], + + patches: [ + { + find: ':"text":', + replacement: { + match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/, + replace: "$1return $self.UserMentionComponent({...arguments[0],OriginalComponent:(()=>{$2})()});" + } + } + ], + + UserMentionComponent: ErrorBoundary.wrap((props: UserMentionComponentProps) => ( + + ), { + fallback: ({ wrappedProps }) => wrappedProps.OriginalComponent + }) +}); From ca9bd5ac149f60e473e593a762cf890dbcf728c5 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Mon, 30 Dec 2024 00:23:53 -0500 Subject: [PATCH 16/17] Update StatusWhilePlaying --- .../{ViewRawVariant => iewRawVariant}/index.tsx | 0 src/equicordplugins/statusWhilePlaying.desktop/index.ts | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/equicordplugins/{ViewRawVariant => iewRawVariant}/index.tsx (100%) diff --git a/src/equicordplugins/ViewRawVariant/index.tsx b/src/equicordplugins/iewRawVariant/index.tsx similarity index 100% rename from src/equicordplugins/ViewRawVariant/index.tsx rename to src/equicordplugins/iewRawVariant/index.tsx diff --git a/src/equicordplugins/statusWhilePlaying.desktop/index.ts b/src/equicordplugins/statusWhilePlaying.desktop/index.ts index 0e204457..874055a2 100644 --- a/src/equicordplugins/statusWhilePlaying.desktop/index.ts +++ b/src/equicordplugins/statusWhilePlaying.desktop/index.ts @@ -5,13 +5,13 @@ */ import { definePluginSettings } from "@api/Settings"; +import { getUserSettingLazy } from "@api/UserSettings"; import { EquicordDevs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { findByCodeLazy } from "@webpack"; import { PresenceStore, UserStore } from "@webpack/common"; let savedStatus = ""; -const updateAsync = findByCodeLazy("updateAsync", "status"); +const statusSettings = getUserSettingLazy("status", "status"); const settings = definePluginSettings({ statusToSet: { type: OptionType.SELECT, @@ -49,11 +49,11 @@ export default definePlugin({ if (event.games.length > 0) { if (status !== settings.store.statusToSet) { savedStatus = status; - updateAsync(settings.store.statusToSet); + statusSettings?.updateSetting(settings.store.statusToSet); } } else { if (savedStatus !== "" && savedStatus !== settings.store.statusToSet) - updateAsync(savedStatus); + statusSettings?.updateSetting(savedStatus); } }, } From 920fad43e10e2a1be6fc16548bde9d95e0aa23eb Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Mon, 30 Dec 2024 00:24:17 -0500 Subject: [PATCH 17/17] Fix Casing On ViewRawVariant --- src/equicordplugins/{iewRawVariant => viewRawVariant}/index.tsx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/equicordplugins/{iewRawVariant => viewRawVariant}/index.tsx (100%) diff --git a/src/equicordplugins/iewRawVariant/index.tsx b/src/equicordplugins/viewRawVariant/index.tsx similarity index 100% rename from src/equicordplugins/iewRawVariant/index.tsx rename to src/equicordplugins/viewRawVariant/index.tsx