Merge remote-tracking branch 'upstream/dev' into dev
Some checks are pending
Test / Test (push) Waiting to run
Release / Build Equicord (push) Waiting to run

This commit is contained in:
thororen1234 2025-05-15 22:03:37 -04:00
commit bec7696ebc
No known key found for this signature in database
6 changed files with 23 additions and 25 deletions

View file

@ -115,7 +115,7 @@ const buildConfigs = ([
...nodeCommonOpts, ...nodeCommonOpts,
entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/main/index.ts")], entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/main/index.ts")],
outfile: "dist/desktop/patcher.js", outfile: "dist/desktop/patcher.js",
footer: { js: "//# sourceURL=VencordPatcher\n" + sourceMapFooter("patcher") }, footer: { js: "//# sourceURL=file:///VencordPatcher\n" + sourceMapFooter("patcher") },
sourcemap, sourcemap,
plugins: [ plugins: [
// @ts-ignore this is never undefined // @ts-ignore this is never undefined
@ -135,7 +135,7 @@ const buildConfigs = ([
outfile: "dist/desktop/renderer.js", outfile: "dist/desktop/renderer.js",
format: "iife", format: "iife",
target: ["esnext"], target: ["esnext"],
footer: { js: "//# sourceURL=VencordRenderer\n" + sourceMapFooter("renderer") }, footer: { js: "//# sourceURL=file:///VencordRenderer\n" + sourceMapFooter("renderer") },
globalName: "Vencord", globalName: "Vencord",
sourcemap, sourcemap,
plugins: [ plugins: [
@ -153,7 +153,7 @@ const buildConfigs = ([
...nodeCommonOpts, ...nodeCommonOpts,
entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/preload.ts")], entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/preload.ts")],
outfile: "dist/desktop/preload.js", outfile: "dist/desktop/preload.js",
footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("preload") }, footer: { js: "//# sourceURL=file:///VencordPreload\n" + sourceMapFooter("preload") },
sourcemap, sourcemap,
define: { define: {
...defines, ...defines,
@ -168,7 +168,7 @@ const buildConfigs = ([
...nodeCommonOpts, ...nodeCommonOpts,
entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/main/index.ts")], entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/main/index.ts")],
outfile: "dist/equibop/main.js", outfile: "dist/equibop/main.js",
footer: { js: "//# sourceURL=VencordMain\n" + sourceMapFooter("main") }, footer: { js: "//# sourceURL=file:///VencordDesktopMain\n" + sourceMapFooter("main") },
sourcemap, sourcemap,
plugins: [ plugins: [
...nodeCommonOpts.plugins, ...nodeCommonOpts.plugins,
@ -187,7 +187,7 @@ const buildConfigs = ([
outfile: "dist/equibop/renderer.js", outfile: "dist/equibop/renderer.js",
format: "iife", format: "iife",
target: ["esnext"], target: ["esnext"],
footer: { js: "//# sourceURL=VencordRenderer\n" + sourceMapFooter("renderer") }, footer: { js: "//# sourceURL=file:///VencordDesktopRenderer\n" + sourceMapFooter("renderer") },
globalName: "Vencord", globalName: "Vencord",
sourcemap, sourcemap,
plugins: [ plugins: [
@ -205,7 +205,7 @@ const buildConfigs = ([
...nodeCommonOpts, ...nodeCommonOpts,
entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/preload.ts")], entryPoints: [join(dirname(fileURLToPath(import.meta.url)), "../../src/preload.ts")],
outfile: "dist/equibop/preload.js", outfile: "dist/equibop/preload.js",
footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("preload") }, footer: { js: "//# sourceURL=file:///VencordPreload\n" + sourceMapFooter("preload") },
sourcemap, sourcemap,
define: { define: {
...defines, ...defines,

View file

@ -92,7 +92,7 @@ const buildConfigs = [
{ {
...commonOptions, ...commonOptions,
outfile: "dist/browser/browser.js", outfile: "dist/browser/browser.js",
footer: { js: "//# sourceURL=VencordWeb" } footer: { js: "//# sourceURL=file:///VencordWeb" }
}, },
{ {
...commonOptions, ...commonOptions,
@ -101,7 +101,7 @@ const buildConfigs = [
...commonOptions.define, ...commonOptions.define,
IS_EXTENSION: "true" IS_EXTENSION: "true"
}, },
footer: { js: "//# sourceURL=VencordWeb" } footer: { js: "//# sourceURL=file:///VencordWeb" }
}, },
{ {
...commonOptions, ...commonOptions,

View file

@ -487,13 +487,13 @@ export default definePlugin({
], ],
}, },
// Message content renderer
{ {
// Message content renderer
find: ".SEND_FAILED,", find: ".SEND_FAILED,",
replacement: { replacement: {
// Render editHistory in the deepest div for message content // Render editHistory behind the message content
match: /(\)\("div",\{id:.+?children:\[)/, match: /\.isFailed]:.+?children:\[/,
replace: "$1 (!!arguments[0].message.editHistory?.length && $self.renderEdits(arguments[0]))," replace: "$&arguments[0]?.message?.editHistory?.length>0&&$self.renderEdits(arguments[0]),"
} }
}, },

View file

@ -388,15 +388,10 @@ export default definePlugin({
find: "#{intl::CHANNEL_CALL_CURRENT_SPEAKER}", find: "#{intl::CHANNEL_CALL_CURRENT_SPEAKER}",
replacement: [ replacement: [
{ {
// Remove the divider and the open chat button for the HiddenChannelLockScreen // Remove the open chat button for the HiddenChannelLockScreen
match: /"more-options-popout"\)\),(?<=channel:(\i).+?inCall:(\i).+?)/, match: /(?<=&&)\i\.push\(.{0,120}"chat-spacer"/,
replace: (m, channel, inCall) => `${m}${inCall}||!$self.isHiddenChannel(${channel},true)&&` replace: "(arguments[0]?.inCall||!$self.isHiddenChannel(arguments[0]?.channel,true))&&$&"
}, }
{
// Remove invite users button for the HiddenChannelLockScreen
match: /"popup".{0,100}?if\((?<=channel:(\i).+?inCall:(\i).+?)/,
replace: (m, channel, inCall) => `${m}(${inCall}||!$self.isHiddenChannel(${channel},true))&&`
},
] ]
}, },
{ {
@ -459,8 +454,8 @@ export default definePlugin({
}, },
{ {
// Remove the open chat button for the HiddenChannelLockScreen // Remove the open chat button for the HiddenChannelLockScreen
match: /"recents".+?&&(?=\(.+?channelId:(\i)\.id,showRequestToSpeakSidebar)/, match: /(?<=&&)\(0,\i\.jsxs?\).{0,180}\.buttonIcon/,
replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&` replace: "!$self.isHiddenChannel(arguments[0]?.channel,true)&&$&"
} }
] ]
}, },

View file

@ -105,6 +105,9 @@ define(Function.prototype, "m", {
} }
const fileName = stack.match(/\/assets\/(.+?\.js)/)?.[1]; const fileName = stack.match(/\/assets\/(.+?\.js)/)?.[1];
if (fileName?.includes("libdiscore")) {
return;
}
// Define a setter for the bundlePath property of WebpackRequire. Only Webpack instances which include chunk loading functionality, // Define a setter for the bundlePath property of WebpackRequire. Only Webpack instances which include chunk loading functionality,
// like the main Discord Webpack, have this property. // like the main Discord Webpack, have this property.
@ -587,7 +590,7 @@ function patchFactory(moduleId: PropertyKey, originalFactory: AnyModuleFactory):
} }
code = newCode; code = newCode;
patchedSource = `// Webpack Module ${String(moduleId)} - Patched by ${pluginsList.join(", ")}\n${newCode}\n//# sourceURL=WebpackModule${String(moduleId)}`; patchedSource = `// Webpack Module ${String(moduleId)} - Patched by ${pluginsList.join(", ")}\n${newCode}\n//# sourceURL=file:///WebpackModule${String(moduleId)}`;
patchedFactory = (0, eval)(patchedSource); patchedFactory = (0, eval)(patchedSource);
if (!patchedBy.has(patch.plugin)) { if (!patchedBy.has(patch.plugin)) {

View file

@ -753,7 +753,7 @@ export function extract(id: string | number) {
// This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!! // This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!!
0,${mod.toString()} 0,${mod.toString()}
//# sourceURL=ExtractedWebpackModule${id} //# sourceURL=file:///ExtractedWebpackModule${id}
`; `;
const extracted = (0, eval)(code); const extracted = (0, eval)(code);
return extracted as Function; return extracted as Function;