mirror of
https://git.1024x2.xyz/1024x2/vexcord.git
synced 2025-04-18 20:46:31 +02:00
Initial commit
This commit is contained in:
commit
5ccb126dec
150
0001-Remove-donator-badges.patch
Normal file
150
0001-Remove-donator-badges.patch
Normal file
@ -0,0 +1,150 @@
|
||||
From 191cf11a7bb70b3a213be50e85bbb0ccdbfbcf67 Mon Sep 17 00:00:00 2001
|
||||
From: 1024x2 <2pow11@gmail.com>
|
||||
Date: Mon, 9 Oct 2023 17:46:41 +0100
|
||||
Subject: [PATCH 1/5] Remove donator badges
|
||||
|
||||
It makes a request to an API hosted by the Vencord developer, without
|
||||
any option to turn it off. This raises privacy concerns.
|
||||
It's easiest to just get rid of the feature entirely.
|
||||
---
|
||||
src/api/Badges.ts | 3 +-
|
||||
src/plugins/_api/badges.tsx | 97 +------------------------------------
|
||||
2 files changed, 2 insertions(+), 98 deletions(-)
|
||||
|
||||
diff --git a/src/api/Badges.ts b/src/api/Badges.ts
|
||||
index b50016c..3529693 100644
|
||||
--- a/src/api/Badges.ts
|
||||
+++ b/src/api/Badges.ts
|
||||
@@ -79,8 +79,7 @@ export function _getBadges(args: BadgeUserArgs) {
|
||||
: badges.push({ ...badge, ...args });
|
||||
}
|
||||
}
|
||||
- const donorBadges = (Plugins.BadgeAPI as unknown as typeof import("../plugins/_api/badges").default).getDonorBadges(args.user.id);
|
||||
- if (donorBadges) badges.unshift(...donorBadges);
|
||||
+ void Plugins.BadgeAPI; // If I don't reference this everything breaks???
|
||||
|
||||
return badges;
|
||||
}
|
||||
diff --git a/src/plugins/_api/badges.tsx b/src/plugins/_api/badges.tsx
|
||||
index 16b244a..4328925 100644
|
||||
--- a/src/plugins/_api/badges.tsx
|
||||
+++ b/src/plugins/_api/badges.tsx
|
||||
@@ -44,19 +44,6 @@ const ContributorBadge: ProfileBadge = {
|
||||
link: "https://github.com/Vendicated/Vencord"
|
||||
};
|
||||
|
||||
-let DonorBadges = {} as Record<string, Array<Record<"tooltip" | "badge", string>>>;
|
||||
-
|
||||
-async function loadBadges(noCache = false) {
|
||||
- DonorBadges = {};
|
||||
-
|
||||
- const init = {} as RequestInit;
|
||||
- if (noCache)
|
||||
- init.cache = "no-cache";
|
||||
-
|
||||
- DonorBadges = await fetch("https://badges.vencord.dev/badges.json", init)
|
||||
- .then(r => r.json());
|
||||
-}
|
||||
-
|
||||
export default definePlugin({
|
||||
name: "BadgeAPI",
|
||||
description: "API to add badges to users.",
|
||||
@@ -91,94 +78,12 @@ export default definePlugin({
|
||||
}
|
||||
],
|
||||
|
||||
- toolboxActions: {
|
||||
- async "Refetch Badges"() {
|
||||
- await loadBadges(true);
|
||||
- Toasts.show({
|
||||
- id: Toasts.genId(),
|
||||
- message: "Successfully refetched badges!",
|
||||
- type: Toasts.Type.SUCCESS
|
||||
- });
|
||||
- }
|
||||
- },
|
||||
-
|
||||
async start() {
|
||||
Vencord.Api.Badges.addBadge(ContributorBadge);
|
||||
- await loadBadges();
|
||||
},
|
||||
|
||||
renderBadgeComponent: ErrorBoundary.wrap((badge: ProfileBadge & BadgeUserArgs) => {
|
||||
const Component = badge.component!;
|
||||
return <Component {...badge} />;
|
||||
- }, { noop: true }),
|
||||
-
|
||||
-
|
||||
- getDonorBadges(userId: string) {
|
||||
- return DonorBadges[userId]?.map(badge => ({
|
||||
- image: badge.badge,
|
||||
- description: badge.tooltip,
|
||||
- position: BadgePosition.START,
|
||||
- props: {
|
||||
- style: {
|
||||
- borderRadius: "50%",
|
||||
- transform: "scale(0.9)" // The image is a bit too big compared to default badges
|
||||
- }
|
||||
- },
|
||||
- onClick() {
|
||||
- const modalKey = openModal(props => (
|
||||
- <ErrorBoundary noop onError={() => {
|
||||
- closeModal(modalKey);
|
||||
- VencordNative.native.openExternal("https://github.com/sponsors/Vendicated");
|
||||
- }}>
|
||||
- <Modals.ModalRoot {...props}>
|
||||
- <Modals.ModalHeader>
|
||||
- <Flex style={{ width: "100%", justifyContent: "center" }}>
|
||||
- <Forms.FormTitle
|
||||
- tag="h2"
|
||||
- style={{
|
||||
- width: "100%",
|
||||
- textAlign: "center",
|
||||
- margin: 0
|
||||
- }}
|
||||
- >
|
||||
- <Heart />
|
||||
- Vencord Donor
|
||||
- </Forms.FormTitle>
|
||||
- </Flex>
|
||||
- </Modals.ModalHeader>
|
||||
- <Modals.ModalContent>
|
||||
- <Flex>
|
||||
- <img
|
||||
- role="presentation"
|
||||
- src="https://cdn.discordapp.com/emojis/1026533070955872337.png"
|
||||
- alt=""
|
||||
- style={{ margin: "auto" }}
|
||||
- />
|
||||
- <img
|
||||
- role="presentation"
|
||||
- src="https://cdn.discordapp.com/emojis/1026533090627174460.png"
|
||||
- alt=""
|
||||
- style={{ margin: "auto" }}
|
||||
- />
|
||||
- </Flex>
|
||||
- <div style={{ padding: "1em" }}>
|
||||
- <Forms.FormText>
|
||||
- This Badge is a special perk for Vencord Donors
|
||||
- </Forms.FormText>
|
||||
- <Forms.FormText className={Margins.top20}>
|
||||
- Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!
|
||||
- </Forms.FormText>
|
||||
- </div>
|
||||
- </Modals.ModalContent>
|
||||
- <Modals.ModalFooter>
|
||||
- <Flex style={{ width: "100%", justifyContent: "center" }}>
|
||||
- <DonateButton />
|
||||
- </Flex>
|
||||
- </Modals.ModalFooter>
|
||||
- </Modals.ModalRoot>
|
||||
- </ErrorBoundary>
|
||||
- ));
|
||||
- },
|
||||
- }));
|
||||
- }
|
||||
+ }, { noop: true })
|
||||
});
|
||||
--
|
||||
2.43.1
|
||||
|
150
0002-Small-rebrand.patch
Normal file
150
0002-Small-rebrand.patch
Normal file
File diff suppressed because one or more lines are too long
45
0003-Experiments-Re-add-staging-banner.patch
Normal file
45
0003-Experiments-Re-add-staging-banner.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From e652044d200bd28b1a6fb214f2a8f33797471238 Mon Sep 17 00:00:00 2001
|
||||
From: 1024x2 <2pow11@gmail.com>
|
||||
Date: Thu, 26 Oct 2023 00:48:25 +0100
|
||||
Subject: [PATCH 3/5] Experiments: Re-add staging banner
|
||||
|
||||
(it's funny)
|
||||
---
|
||||
src/plugins/experiments/index.tsx | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx
|
||||
index f8ea4b0..dc4f78f 100644
|
||||
--- a/src/plugins/experiments/index.tsx
|
||||
+++ b/src/plugins/experiments/index.tsx
|
||||
@@ -33,6 +33,12 @@ const settings = definePluginSettings({
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
restartNeeded: true
|
||||
+ },
|
||||
+ forceStagingBanner: {
|
||||
+ description: "Whether to force Staging banner under user area.",
|
||||
+ type: OptionType.BOOLEAN,
|
||||
+ default: false,
|
||||
+ restartNeeded: true
|
||||
}
|
||||
});
|
||||
|
||||
@@ -77,6 +83,14 @@ export default definePlugin({
|
||||
}
|
||||
]
|
||||
},
|
||||
+ {
|
||||
+ find: ".Messages.DEV_NOTICE_STAGING",
|
||||
+ predicate: () => settings.store.forceStagingBanner,
|
||||
+ replacement: {
|
||||
+ match: /window\.GLOBAL_ENV\.RELEASE_CHANNEL/,
|
||||
+ replace: "\"staging\""
|
||||
+ }
|
||||
+ },
|
||||
{
|
||||
find: 'H1,title:"Experiments"',
|
||||
replacement: {
|
||||
--
|
||||
2.43.1
|
||||
|
@ -0,0 +1,27 @@
|
||||
From 917df10a7d166fdfb4479ee28c40cb884bfc37dc Mon Sep 17 00:00:00 2001
|
||||
From: 1024x2 <2pow11@gmail.com>
|
||||
Date: Wed, 11 Oct 2023 15:55:03 +0100
|
||||
Subject: [PATCH 4/5] Updater: don't prompt for updates when on a local branch
|
||||
|
||||
---
|
||||
src/main/updater/git.ts | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/updater/git.ts b/src/main/updater/git.ts
|
||||
index 2ff3ba5..21f33d1 100644
|
||||
--- a/src/main/updater/git.ts
|
||||
+++ b/src/main/updater/git.ts
|
||||
@@ -49,9 +49,7 @@ async function getRepo() {
|
||||
async function calculateGitChanges() {
|
||||
await git("fetch");
|
||||
|
||||
- const branch = await git("branch", "--show-current");
|
||||
-
|
||||
- const res = await git("log", `HEAD...origin/${branch.stdout.trim()}`, "--pretty=format:%an/%h/%s");
|
||||
+ const res = await git("log", "HEAD...@{u}", "--pretty=format:%an/%h/%s");
|
||||
|
||||
const commits = res.stdout.trim();
|
||||
return commits ? commits.split("\n").map(line => {
|
||||
--
|
||||
2.43.1
|
||||
|
29
0005-Enable-CSP-bypass-on-stock-discord-desktop-client.patch
Normal file
29
0005-Enable-CSP-bypass-on-stock-discord-desktop-client.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From a88292149ce6bf585d2340774ab605ac88ebb742 Mon Sep 17 00:00:00 2001
|
||||
From: 1024x2 <2pow11@gmail.com>
|
||||
Date: Wed, 27 Dec 2023 15:05:44 +0000
|
||||
Subject: [PATCH 5/5] Enable CSP bypass on stock discord desktop client
|
||||
|
||||
---
|
||||
src/main/index.ts | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/index.ts b/src/main/index.ts
|
||||
index 481736a..33dbe3f 100644
|
||||
--- a/src/main/index.ts
|
||||
+++ b/src/main/index.ts
|
||||
@@ -23,10 +23,11 @@ import { ensureSafePath, getSettings } from "./ipcMain";
|
||||
import { IS_VANILLA, THEMES_DIR } from "./utils/constants";
|
||||
import { installExt } from "./utils/extensions";
|
||||
|
||||
-if (IS_VESKTOP || !IS_VANILLA) {
|
||||
+{
|
||||
app.whenReady().then(() => {
|
||||
// Source Maps! Maybe there's a better way but since the renderer is executed
|
||||
// from a string I don't think any other form of sourcemaps would work
|
||||
+ if (IS_VESKTOP || !IS_VANILLA)
|
||||
protocol.registerFileProtocol("vencord", ({ url: unsafeUrl }, cb) => {
|
||||
let url = unsafeUrl.slice("vencord://".length);
|
||||
if (url.endsWith("/")) url = url.slice(0, -1);
|
||||
--
|
||||
2.43.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user