From 6c58d118af3a3e57fc1d5b171867faac308e4e25 Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Fri, 13 Dec 2024 15:17:51 -0500
Subject: [PATCH] NeverPausePreviews
---
.../neverPausePreviews/index.ts | 49 +++++++++++++++++++
src/utils/constants.ts | 10 ++--
2 files changed, 56 insertions(+), 3 deletions(-)
create mode 100644 src/equicordplugins/neverPausePreviews/index.ts
diff --git a/src/equicordplugins/neverPausePreviews/index.ts b/src/equicordplugins/neverPausePreviews/index.ts
new file mode 100644
index 00000000..95812446
--- /dev/null
+++ b/src/equicordplugins/neverPausePreviews/index.ts
@@ -0,0 +1,49 @@
+/*
+ * 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: "NeverPausePreviews",
+ description: "Prevents in-call/PiP previews (screenshare, streams, etc) from pausing even if the client loses focus",
+ authors: [EquicordDevs.vappstar],
+ patches: [
+ {
+ find: "streamerPaused()",
+ replacement: {
+ match: /return null![^}]+/,
+ replace: "return false"
+ }
+ },
+ {
+ find: "onSpinnerStarted():null",
+ replacement: {
+ match: /paused:\i([^=])/,
+ replace: "paused:false$1"
+ }
+ },
+ {
+ find: "let{mainText:",
+ replacement: {
+ match: /let{[^;]+/,
+ replace: "return"
+ }
+ }
+ ],
+});
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index e36f36b9..07540838 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -942,11 +942,11 @@ export const EquicordDevs = Object.freeze({
},
Z1xus: {
name: "Z1xus",
- id: 377450600797044746n,
+ id: 377450600797044746n
},
Oggetto: {
name: "Oggetto",
- id: 619203349954166804n,
+ id: 619203349954166804n
},
zyqunix: {
name: "zyqunix",
@@ -954,12 +954,16 @@ export const EquicordDevs = Object.freeze({
},
examplegit: {
name: "example.user",
- id: 175411535357673473n,
+ id: 175411535357673473n
},
Loukios: {
name: "Loukios",
id: 211461918127292416n
},
+ vappstar: {
+ name: "vappstar",
+ id: 747192967311261748n
+ }
} satisfies Record);
// iife so #__PURE__ works correctly