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 {
await access(extDir, fsConstants.F_OK);
} catch (err) {
const url = id === "fmkadmapgofadopljbjfkapdkoienihi"
// 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 url = `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, {
headers: {

View file

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

View file

@ -67,8 +67,10 @@ export default definePlugin({
{
find: '="SYSTEM_TAG"',
replacement: {
match: /(?<=\.username.{0,50}?)style:/,
replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])},_style:"
// Override colorString with our custom color and disable gradients if applying the custom color.
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) {
const userId: string | undefined = context?.message?.author?.id;
const colorString = context?.author?.colorString;
@ -101,6 +110,7 @@ export default definePlugin({
return customColor ?? colorString;
}
},
calculateNameColorForListContext(context: any) {
const id = context?.user?.id;
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.
{
match: /(\.tabBarItem.+?variant:)"heading-lg\/medium"/,
replace: '$1"heading-sm/medium"'
match: /(\.tabBarItem.+?variant:)"heading-md\/normal"/,
replace: '$1"heading-sm/normal"'
}
]
},