From 87ae710e3b40cc2c000e2b8d42167998b8d5efa6 Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 17:20:42 +0200 Subject: [PATCH 01/13] Add NeverPausePreviews plugin --- src/plugins/NeverPausePreviews/index.ts | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/plugins/NeverPausePreviews/index.ts diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts new file mode 100644 index 000000000..a5e96582a --- /dev/null +++ b/src/plugins/NeverPausePreviews/index.ts @@ -0,0 +1,35 @@ +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "NeverPausePreviews", + description: "Prevents in-call/PiP previews (screenshare, streams, etc) from pausing even if the client loses focus", + authors: [ + { + id: 747192967311261748n, + name: "vappster", + }, + ], + patches: [ + { //picture-in-picture player patch + find: "streamerPaused()", + replacement: { + match: /return (.{0,120})&&!.{1,2}}/, + replace: "return $1&&false}" + } + }, + { //in-call player patch #1 (keep stream playing) + find: /videoComponent:.{1,2},className:/, + replacement: { + match: "paused:p})", + replace: "paused:false})" + } + }, + { //in-call player patch #2 (disable "your stream is still running" text overlay) + find: /let{mainText:.{1,2},supportingText:.{1,2}/, + replacement: { + match: /let{.{0,120};/, + replace: "return;" + } + } + ], +}); From fb202f027a2e3baf1fbd4360598965f9499cb9ff Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 18:47:15 +0200 Subject: [PATCH 02/13] [NeverPausePreviews] Update in-call player patch #1 --- src/plugins/NeverPausePreviews/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index a5e96582a..d754b51cb 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -20,7 +20,7 @@ export default definePlugin({ { //in-call player patch #1 (keep stream playing) find: /videoComponent:.{1,2},className:/, replacement: { - match: "paused:p})", + match: /paused:.{1,2}}\)/, replace: "paused:false})" } }, From 7619c572d9d6a14ec554ad13ac1b81cca246938f Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 19:07:11 +0200 Subject: [PATCH 03/13] Revert "[NeverPausePreviews] Update in-call player patch #1" This reverts commit fb202f027a2e3baf1fbd4360598965f9499cb9ff. --- src/plugins/NeverPausePreviews/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index d754b51cb..a5e96582a 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -20,7 +20,7 @@ export default definePlugin({ { //in-call player patch #1 (keep stream playing) find: /videoComponent:.{1,2},className:/, replacement: { - match: /paused:.{1,2}}\)/, + match: "paused:p})", replace: "paused:false})" } }, From 559066c600636e66818261dd7c2cc4a16415dda8 Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 19:10:44 +0200 Subject: [PATCH 04/13] [NeverPausePreviews] whoops --- src/plugins/NeverPausePreviews/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index a5e96582a..d754b51cb 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -20,7 +20,7 @@ export default definePlugin({ { //in-call player patch #1 (keep stream playing) find: /videoComponent:.{1,2},className:/, replacement: { - match: "paused:p})", + match: /paused:.{1,2}}\)/, replace: "paused:false})" } }, From cacbdc1f1d2258c4f75169bcb7e57f5729a0ab69 Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 20:15:43 +0200 Subject: [PATCH 05/13] Added myself to devs --- src/utils/constants.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index ff754d5c2..c57639de7 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -524,11 +524,15 @@ export const Devs = /* #__PURE__*/ Object.freeze({ }, nyx: { name: "verticalsync", - id: 328165170536775680n + id: 328165170536775680n, }, nekohaxx: { name: "nekohaxx", - id: 1176270221628153886n + id: 1176270221628153886n, + }, + vappster: { + name: "vappster", + id: 747192967311261748n } } satisfies Record); From 7e16a1f95457a4edfe22ece3789c45e59bad7306 Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 20:18:07 +0200 Subject: [PATCH 06/13] Added license header, avoid regex in finds, made requested edits --- src/plugins/NeverPausePreviews/index.ts | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index d754b51cb..495b19c31 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -1,14 +1,28 @@ +/* + * 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 { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; export default definePlugin({ name: "NeverPausePreviews", description: "Prevents in-call/PiP previews (screenshare, streams, etc) from pausing even if the client loses focus", - authors: [ - { - id: 747192967311261748n, - name: "vappster", - }, - ], + authors: [Devs.vappster], patches: [ { //picture-in-picture player patch find: "streamerPaused()", @@ -18,14 +32,14 @@ export default definePlugin({ } }, { //in-call player patch #1 (keep stream playing) - find: /videoComponent:.{1,2},className:/, + find: "VideoStreamFit:", replacement: { match: /paused:.{1,2}}\)/, replace: "paused:false})" } }, { //in-call player patch #2 (disable "your stream is still running" text overlay) - find: /let{mainText:.{1,2},supportingText:.{1,2}/, + find: "let{mainText:", replacement: { match: /let{.{0,120};/, replace: "return;" From 4e17dfcc65ef2430403b55b07faf6eb475e0945a Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 20:56:00 +0200 Subject: [PATCH 07/13] Improve patches --- src/plugins/NeverPausePreviews/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index 495b19c31..b09fc3797 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -27,8 +27,8 @@ export default definePlugin({ { //picture-in-picture player patch find: "streamerPaused()", replacement: { - match: /return (.{0,120})&&!.{1,2}}/, - replace: "return $1&&false}" + match: /return null![^}]+/, + replace: "return false" } }, { //in-call player patch #1 (keep stream playing) @@ -41,8 +41,8 @@ export default definePlugin({ { //in-call player patch #2 (disable "your stream is still running" text overlay) find: "let{mainText:", replacement: { - match: /let{.{0,120};/, - replace: "return;" + match: /let{[^;]+/, + replace: "return" } } ], From 5c897f4e0ebc06bf32c9677f743d63acebbc781f Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 21:48:55 +0200 Subject: [PATCH 08/13] Update src/plugins/NeverPausePreviews/index.ts Co-authored-by: goodbee <100511746+schoeneBiene@users.noreply.github.com> --- src/plugins/NeverPausePreviews/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index b09fc3797..8c74c921d 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -34,7 +34,7 @@ export default definePlugin({ { //in-call player patch #1 (keep stream playing) find: "VideoStreamFit:", replacement: { - match: /paused:.{1,2}}\)/, + match: /paused:\i}\)/, replace: "paused:false})" } }, From caf1779be3dd9d43f67cb255942264a279db018c Mon Sep 17 00:00:00 2001 From: Masterjoona <69722179+Masterjoona@users.noreply.github.com> Date: Sat, 8 Jun 2024 19:33:58 +0300 Subject: [PATCH 09/13] fix showconnections in new profiles (#2567) Co-authored-by: Vendicated --- src/plugins/showConnections/index.tsx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx index a78e4c418..505f696d8 100644 --- a/src/plugins/showConnections/index.tsx +++ b/src/plugins/showConnections/index.tsx @@ -74,15 +74,15 @@ interface ConnectionPlatform { icon: { lightSVG: string, darkSVG: string; }; } -const profilePopoutComponent = ErrorBoundary.wrap((props: { user: User, displayProfile; }) => - +const profilePopoutComponent = ErrorBoundary.wrap((props: { user: User, displayProfile, compactSpacing; }) => + ); const profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) => ); -function ConnectionsComponent({ id, theme }: { id: string, theme: string; }) { +function ConnectionsComponent({ id, theme, compactSpacing }: { id: string, theme: string, compactSpacing?: boolean; }) { const profile = UserProfileStore.getUserProfile(id); if (!profile) return null; @@ -91,8 +91,10 @@ function ConnectionsComponent({ id, theme }: { id: string, theme: string; }) { if (!connections?.length) return null; + const Container = compactSpacing ? "div" : Section; + return ( -
+ {connections.map(connection => )} -
+ ); } @@ -178,7 +180,7 @@ export default definePlugin({ find: "{isUsingGuildBio:null!==(", replacement: { match: /,theme:\i\}\)(?=,.{0,150}setNote:)/, - replace: "$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile })" + replace: "$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile, compactSpacing: false })" } }, { @@ -188,6 +190,13 @@ export default definePlugin({ match: /\(0,\i\.jsx\)\(\i\.\i,\{\}\).{0,100}setNote:(?=.+?channelId:(\i).id)/, replace: "$self.profilePanelComponent({ id: $1.recipients[0] }),$&" } + }, + { + find: "autoFocusNote:!0})", + replacement: { + match: /{autoFocusNote:!1}\)}\)(?<=user:(\i),bio:null==(\i)\?.+?)/, + replace: "$&,$self.profilePopoutComponent({ user: $1, displayProfile: $2, compactSpacing: true })" + } } ], settings, From fe390bf06355a511db8a733ad01e9f49e4393948 Mon Sep 17 00:00:00 2001 From: programminglaboratorys <107296738+programminglaboratorys@users.noreply.github.com> Date: Sat, 8 Jun 2024 21:56:23 +0300 Subject: [PATCH 10/13] RoleColorEverywhere: show role colors in the reactor list (#2490) Co-authored-by: vee --- src/plugins/roleColorEverywhere/index.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index 56b224da8..23084a680 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -40,9 +40,16 @@ const settings = definePluginSettings({ default: true, description: "Show role colors in the voice chat user list", restartNeeded: true + }, + reactorsList: { + type: OptionType.BOOLEAN, + default: true, + description: "Show role colors in the reactors list", + restartNeeded: true } }); + export default definePlugin({ name: "RoleColorEverywhere", authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN], @@ -99,6 +106,14 @@ export default definePlugin({ } ], predicate: () => settings.store.voiceUsers, + }, + { + find: ".reactorDefault", + replacement: { + match: /\.openUserContextMenu\)\((\i),(\i),\i\).{0,250}tag:"strong"/, + replace: "$&,style:{color:$self.getColor($2?.id,$1)}" + }, + predicate: () => settings.store.reactorsList, } ], settings, From 43ae944d08624655077028194456d693da558fb0 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 8 Jun 2024 21:56:59 +0200 Subject: [PATCH 11/13] BadgeAPI: fix our badges not showing if there are 0 discord badges --- src/plugins/_api/badges/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx index b4ee45a1d..d8e391ae9 100644 --- a/src/plugins/_api/badges/index.tsx +++ b/src/plugins/_api/badges/index.tsx @@ -93,17 +93,13 @@ export default definePlugin({ { find: ".PANEL]:14", replacement: { - match: /(?<=\i=\(0,\i\.default\)\(\i\);)return 0===\i.length/, - replace: "$& && $self.getBadges(arguments[0]?.displayProfile).length===0" + match: /(?<=(\i)=\(0,\i\.default\)\(\i\);)return 0===\i.length\?/, + replace: "$1.unshift(...$self.getBadges(arguments[0].displayProfile));$&" } }, { find: ".description,delay:", replacement: [ - { - match: /...(\i)\}=\(0,\i\.useUserProfileAnalyticsContext\)\(\);/, - replace: "$&arguments[0].badges?.unshift(...$self.getBadges($1));" - }, { // alt: "", aria-hidden: false, src: originalSrc match: /alt:" ","aria-hidden":!0,src:(?=.{0,20}(\i)\.icon)/, From 63c4b2304fabba58eaae69f7a3a9fa0778dfeb3b Mon Sep 17 00:00:00 2001 From: Koda!! <162957404+Kodarru@users.noreply.github.com> Date: Wed, 19 Jun 2024 01:05:16 -0700 Subject: [PATCH 12/13] =?UTF-8?q?Remove=20the=20GitHub=20Math=20Bug=20(It'?= =?UTF-8?q?s=20Patched=20Now=20=F0=9F=98=94)=20(#2564)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index e67db93a2..61575d4bb 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,3 @@ Regardless, if your account is very important to you and it getting disabled wou Additionally, make sure not to post screenshots with Vencord in a server where you might get banned for it - -```math -\ce{$\unicode[goombafont; color:red; z-index: -10; position: fixed; top: 0; left: 0; height: 100%; object-fit: cover; width: 100%; opacity: 1; background: url('https://github.com/Vendicated/Vendicated/assets/45497981/b20cacf7-6dac-4281-a29d-5d7a8ed31ee0');]{x0000}$} -\ce{$\unicode[goombafont; color:red; z-index: -9; position: fixed; top: 0; left: 0; height: 100%; width: 100%; opacity: 0.9; background: var(--bgColor-default);]{x0000}$} -``` From 4458e701a5af533958d1d6f850ba70ea5fcffb03 Mon Sep 17 00:00:00 2001 From: vappster Date: Wed, 19 Jun 2024 23:46:34 +0200 Subject: [PATCH 13/13] Update in-call player patch 1 (Discord doomsday fix) & improve match regex --- src/plugins/NeverPausePreviews/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index 8c74c921d..0f34aaf72 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -32,10 +32,10 @@ export default definePlugin({ } }, { //in-call player patch #1 (keep stream playing) - find: "VideoStreamFit:", + find: "onSpinnerStarted():null", replacement: { - match: /paused:\i}\)/, - replace: "paused:false})" + match: /paused:\i([^=])/, + replace: "paused:false$1" } }, { //in-call player patch #2 (disable "your stream is still running" text overlay)