Fixes For CustomUserColors
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-13 01:09:42 -04:00
parent e941ba88c0
commit 7cd521cb0e
No known key found for this signature in database
2 changed files with 34 additions and 39 deletions

View file

@ -96,19 +96,13 @@ export default definePlugin({
const color = calculateNameColorForUser(userId);
const customColor = userId && Settings.plugins.CustomUserColors.enabled ? getCustomColorString(userId, true) : null;
// Color preview in role settings
if (context?.message?.channel_id === "1337" && userId === "313337")
return customColor ?? colorString;
if (
(context?.message?.channel_id === "1337" && userId === "313337") ||
(settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) ||
(settings.store.applyColorOnlyToUsersWithoutColor && colorString)
) return customColor ?? colorString;
if (settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) {
return customColor ?? colorString;
}
if (!settings.store.applyColorOnlyToUsersWithoutColor || !colorString) {
return customColor ?? color;
} else {
return customColor ?? colorString;
}
return customColor ?? color;
},
calculateNameColorForListContext(context: any) {
@ -117,14 +111,11 @@ export default definePlugin({
const color = calculateNameColorForUser(id);
const customColor = id && Settings.plugins.CustomUserColors.enabled ? getCustomColorString(id, true) : null;
if (settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) {
return customColor ?? colorString;
}
if (
(settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) ||
(settings.store.applyColorOnlyToUsersWithoutColor && colorString)
) return customColor ?? colorString;
if (!settings.store.applyColorOnlyToUsersWithoutColor || !colorString) {
return customColor ?? color;
} else {
return customColor ?? colorString;
}
return customColor ?? color;
}
});