Equicord Protocol

This commit is contained in:
thororen1234 2024-07-25 01:13:32 -04:00
parent 7518709310
commit 485452f65a
7 changed files with 32 additions and 7 deletions

View file

@ -67,7 +67,7 @@ export const _handleCommand = function (cmd: Command, args: Argument[], ctx: Com
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
content: `${msg}:\n${makeCodeblock(reason)}`, content: `${msg}:\n${makeCodeblock(reason)}`,
author: { author: {
username: "Vencord" username: "Equicord"
} }
}); });
}; };

View file

@ -12,7 +12,7 @@ import { openNewPluginsModal } from "./NewPluginsModal";
export default definePlugin({ export default definePlugin({
name: "NewPluginsManager", name: "NewPluginsManager",
description: "Utility that notifies you when new plugins are added to Vencord", description: "Utility that notifies you when new plugins are added to Equicord",
authors: [Devs.Sqaaakoi], authors: [Devs.Sqaaakoi],
flux: { flux: {
async POST_CONNECTION_OPEN() { async POST_CONNECTION_OPEN() {

View file

@ -15,7 +15,7 @@ const rootTitle = { base: null as string | null };
export const settings = definePluginSettings({ export const settings = definePluginSettings({
title: { title: {
type: OptionType.STRING, type: OptionType.STRING,
default: "Vencord", default: "Equicord",
description: "Window title prefix", description: "Window title prefix",
onChange: setTitle, onChange: setTitle,
}, },

View file

@ -241,7 +241,7 @@ async function createActivity(): Promise<Activity | undefined> {
let { type } = settings.store; let { type } = settings.store;
let appName = "Vencord"; let appName = "Equicord";
let details = ""; let details = "";
let state = ""; let state = "";
let imageBig = ""; let imageBig = "";

View file

@ -53,6 +53,31 @@ if (IS_VESKTOP || !IS_VANILLA) {
} }
}); });
protocol.registerFileProtocol("equicord", ({ url: unsafeUrl }, cb) => {
let url = unsafeUrl.slice("equicord://".length);
if (url.endsWith("/")) url = url.slice(0, -1);
if (url.startsWith("/themes/")) {
const theme = url.slice("/themes/".length);
const safeUrl = ensureSafePath(THEMES_DIR, theme);
if (!safeUrl) {
cb({ statusCode: 403 });
return;
}
cb(safeUrl.replace(/\?v=\d+$/, ""));
return;
}
switch (url) {
case "renderer.js.map":
case "preload.js.map":
case "patcher.js.map":
case "main.js.map":
cb(join(__dirname, url));
break;
default:
cb({ statusCode: 403 });
}
});
try { try {
if (RendererSettings.store.enableReactDevtools) if (RendererSettings.store.enableReactDevtools)
installExt("fmkadmapgofadopljbjfkapdkoienihi") installExt("fmkadmapgofadopljbjfkapdkoienihi")

View file

@ -271,7 +271,7 @@ function sendMsgNotif(titleString: string, content: string, message: Message) {
content: content, content: content,
useBase64Icon: true, useBase64Icon: true,
icon: result, icon: result,
sourceApp: "Vencord" sourceApp: "Equicord"
}; };
Native.sendToOverlay(msgData); Native.sendToOverlay(msgData);
}); });
@ -290,7 +290,7 @@ function sendOtherNotif(content: string, titleString: string) {
content: content, content: content,
useBase64Icon: false, useBase64Icon: false,
icon: null, icon: null,
sourceApp: "Vencord" sourceApp: "Equicord"
}; };
Native.sendToOverlay(msgData); Native.sendToOverlay(msgData);
} }

View file

@ -68,7 +68,7 @@ export async function compileUsercss(fileName: string) {
const preprocessorFn = preprocessors[preprocessor]; const preprocessorFn = preprocessors[preprocessor];
if (!preprocessorFn) { if (!preprocessorFn) {
UserCSSLogger.error("File", fileName, "requires preprocessor", preprocessor, "which isn't known to Vencord"); UserCSSLogger.error("File", fileName, "requires preprocessor", preprocessor, "which isn't known to Equicord");
return null; return null;
} }