Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2025-05-13 00:54:00 -04:00
commit e941ba88c0
No known key found for this signature in database
4 changed files with 16 additions and 12 deletions

View file

@ -67,13 +67,7 @@ export async function installExt(id: string) {
try { try {
await access(extDir, fsConstants.F_OK); await access(extDir, fsConstants.F_OK);
} catch (err) { } catch (err) {
const url = id === "fmkadmapgofadopljbjfkapdkoienihi" const url = `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=${process.versions.chrome}`;
// React Devtools v4.25
// v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843
// Unfortunately, Google does not serve old versions, so this is the only way
// This zip file is pinned to long commit hash so it cannot be changed remotely
? "https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip"
: `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=${process.versions.chrome}`;
const buf = await get(url, { const buf = await get(url, {
headers: { headers: {

View file

@ -197,7 +197,7 @@ export default definePlugin({
}, },
// Patches Discord generic logger function // Patches Discord generic logger function
{ {
find: "Σ:", find: '"file-only"!==',
predicate: () => settings.store.disableLoggers, predicate: () => settings.store.disableLoggers,
replacement: { replacement: {
match: /(?<=&&)(?=console)/, match: /(?<=&&)(?=console)/,

View file

@ -67,8 +67,10 @@ export default definePlugin({
{ {
find: '="SYSTEM_TAG"', find: '="SYSTEM_TAG"',
replacement: { replacement: {
match: /(?<=\.username.{0,50}?)style:/, // Override colorString with our custom color and disable gradients if applying the custom color.
replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])},_style:" match: /&&null!=\i\.secondaryColor,(?<=colorString:(\i).+?(\i)=.+?)/,
replace: (m, colorString, hasGradientColors) => `${m}` +
`vcIrcColorsDummy=[${colorString},${hasGradientColors}]=$self.getMessageColorsVariables(arguments[0],${hasGradientColors}),`
} }
}, },
{ {
@ -81,6 +83,13 @@ export default definePlugin({
} }
], ],
getMessageColorsVariables(context: any, hasGradientColors: boolean) {
const colorString = this.calculateNameColorForMessageContext(context);
const originalColorString = context?.author?.colorString;
return [colorString, hasGradientColors && colorString === originalColorString];
},
calculateNameColorForMessageContext(context: any) { calculateNameColorForMessageContext(context: any) {
const userId: string | undefined = context?.message?.author?.id; const userId: string | undefined = context?.message?.author?.id;
const colorString = context?.author?.colorString; const colorString = context?.author?.colorString;
@ -101,6 +110,7 @@ export default definePlugin({
return customColor ?? colorString; return customColor ?? colorString;
} }
}, },
calculateNameColorForListContext(context: any) { calculateNameColorForListContext(context: any) {
const id = context?.user?.id; const id = context?.user?.id;
const colorString = context?.colorString; const colorString = context?.colorString;

View file

@ -126,8 +126,8 @@ export default definePlugin({
}, },
// Make the tab bar item text smaller so our tab can fit. // Make the tab bar item text smaller so our tab can fit.
{ {
match: /(\.tabBarItem.+?variant:)"heading-lg\/medium"/, match: /(\.tabBarItem.+?variant:)"heading-md\/normal"/,
replace: '$1"heading-sm/medium"' replace: '$1"heading-sm/normal"'
} }
] ]
}, },