diff --git a/src/equicordplugins/customUserColors/index.tsx b/src/equicordplugins/customUserColors/index.tsx index 74e88120..57134557 100644 --- a/src/equicordplugins/customUserColors/index.tsx +++ b/src/equicordplugins/customUserColors/index.tsx @@ -81,23 +81,22 @@ export default definePlugin({ patches: [ { // this also affects name headers in chats outside of servers - find: '"BaseUsername"', + find: '="SYSTEM_TAG"', replacement: { - match: /style:\i.{0,100}void 0:void 0/, - replace: "style:{color:$self.colorIfServer(arguments[0])}" + match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0,)/, + replace: "style:{color:$self.colorIfServer(arguments[0])}," }, - noWarn: true, + predicate: () => !Settings.plugins.IrcColors.enabled }, { - predicate: () => settings.store.dmList, find: "PrivateChannel.renderAvatar", replacement: { match: /(highlighted:\i,)/, replace: "$1style:{color:`${$self.colorDMList(arguments[0])}`}," }, + predicate: () => settings.store.dmList, }, { - predicate: () => settings.store.dmList, find: "!1,wrapContent", replacement: [ { @@ -109,6 +108,7 @@ export default definePlugin({ replace: "style:style||{}," }, ], + predicate: () => settings.store.dmList, }, ], diff --git a/src/plugins/betterRoleDot/index.ts b/src/plugins/betterRoleDot/index.ts index 3a8a1456..97ca5cdc 100644 --- a/src/plugins/betterRoleDot/index.ts +++ b/src/plugins/betterRoleDot/index.ts @@ -24,8 +24,7 @@ import { Clipboard, Toasts } from "@webpack/common"; export default definePlugin({ name: "BetterRoleDot", authors: [Devs.Ven, Devs.AutumnVN], - description: - "Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously", + description: "Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously", patches: [ { diff --git a/src/plugins/betterUploadButton/index.ts b/src/plugins/betterUploadButton/index.ts index 29827a5e..3c4c075f 100644 --- a/src/plugins/betterUploadButton/index.ts +++ b/src/plugins/betterUploadButton/index.ts @@ -27,12 +27,6 @@ export default definePlugin({ { find: '"ChannelAttachButton"', replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /\.attachButtonInner,"aria-label":.{0,50},onDoubleClick:(.+?:void 0),.{0,30}?\.\.\.(\i),/, - replace: "$&onClick:$1,onContextMenu:$2.onClick,", - noWarn: true - }, { match: /\.attachButtonInner,"aria-label":.{0,50},onDoubleClick:(.+?:void 0),.{0,100}\},(\i)\).{0,100}children:\i/, replace: "$&,onClick:$1,onContextMenu:$2.onClick,", diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 8f778177..248c93bc 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -49,18 +49,6 @@ export default definePlugin({ { find: ".decorationGridItem,", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<==)\i=>{let{children.{20,200}decorationGridItem/, - replace: "$self.DecorationGridItem=$&", - noWarn: true - }, - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<==)\i=>{let{user:\i,avatarDecoration/, - replace: "$self.DecorationGridDecoration=$&", - noWarn: true - }, { match: /(?<==)\i=>{var{children.{20,200}decorationGridItem/, replace: "$self.DecorationGridItem=$&", diff --git a/src/plugins/ircColors/index.ts b/src/plugins/ircColors/index.ts index d547a0e1..5363acc0 100644 --- a/src/plugins/ircColors/index.ts +++ b/src/plugins/ircColors/index.ts @@ -16,7 +16,8 @@ * along with this program. If not, see . */ -import { definePluginSettings } from "@api/Settings"; +import { definePluginSettings, Settings } from "@api/Settings"; +import { getCustomColorString } from "@equicordplugins/customUserColors"; import { hash as h64 } from "@intrnl/xxhash64"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; @@ -66,7 +67,7 @@ export default definePlugin({ { find: '="SYSTEM_TAG"', replacement: { - match: /(?<=className:\i\.username,style:.{0,50}:void 0,)/, + match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0,)/, replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])}," } }, @@ -84,30 +85,36 @@ export default definePlugin({ const userId: string | undefined = context?.message?.author?.id; const colorString = context?.author?.colorString; 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 colorString; + return customColor ?? colorString; if (settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) { - return colorString; + return customColor ?? colorString; } - return (!settings.store.applyColorOnlyToUsersWithoutColor || !colorString) - ? color - : colorString; + if (!settings.store.applyColorOnlyToUsersWithoutColor || !colorString) { + return customColor ?? color; + } else { + return customColor ?? colorString; + } }, calculateNameColorForListContext(context: any) { const id = context?.user?.id; const colorString = context?.colorString; const color = calculateNameColorForUser(id); + const customColor = id && Settings.plugins.CustomUserColors.enabled ? getCustomColorString(id, true) : null; if (settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) { - return colorString; + return customColor ?? colorString; } - return (!settings.store.applyColorOnlyToUsersWithoutColor || !colorString) - ? color - : colorString; + if (!settings.store.applyColorOnlyToUsersWithoutColor || !colorString) { + return customColor ?? color; + } else { + return customColor ?? colorString; + } } }); diff --git a/src/plugins/memberCount/index.tsx b/src/plugins/memberCount/index.tsx index ad7491cc..c563c037 100644 --- a/src/plugins/memberCount/index.tsx +++ b/src/plugins/memberCount/index.tsx @@ -66,12 +66,6 @@ export default definePlugin({ { find: "{isSidebarVisible:", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<=let\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/, - replace: ":[$1?.startsWith('members')?$self.render():null,$2", - noWarn: true - }, { match: /(?<=var\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/, replace: ":[$1?.startsWith('members')?$self.render():null,$2", diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index e3cb2129..ff3911f5 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -84,12 +84,6 @@ export default definePlugin({ { find: ".USER_MENTION)", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /onContextMenu:\i,color:\i,\.\.\.\i(?=,children:)(?<=user:(\i),channel:(\i).{0,500}?)/, - replace: "$&,color:$self.getColorInt($1?.id,$2?.id)", - noWarn: true - }, { match: /(?<=onContextMenu:\i,color:)\i(?=\},\i\),\{children)(?<=user:(\i),channel:(\i).{0,500}?)/, replace: "$self.getColorInt($1?.id,$2?.id)", diff --git a/src/plugins/showMeYourName/index.tsx b/src/plugins/showMeYourName/index.tsx index 0306b7d5..da752c45 100644 --- a/src/plugins/showMeYourName/index.tsx +++ b/src/plugins/showMeYourName/index.tsx @@ -56,7 +56,7 @@ export default definePlugin({ { find: '?"@":""', replacement: { - match: /(?<=children:)\(\i\?"@":""\)\+\i(?=,|\})/, + match: /(?<=onContextMenu:\i,children:)\i\+\i/, replace: "$self.renderUsername(arguments[0])" } }, diff --git a/src/plugins/startupTimings/index.tsx b/src/plugins/startupTimings/index.tsx index ac7f3f0c..106ae65f 100644 --- a/src/plugins/startupTimings/index.tsx +++ b/src/plugins/startupTimings/index.tsx @@ -28,14 +28,6 @@ export default definePlugin({ patches: [{ find: "#{intl::ACTIVITY_SETTINGS}", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+}\)}\))/, - replace: (_, commaOrSemi, settings, elements) => "" + - `${commaOrSemi}${settings}?.[0]==="CHANGELOG"` + - `&&${elements}.push({section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage})`, - noWarn: true - }, { match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+\)\)\}\))(?=\)\})/, replace: (_, commaOrSemi, settings, elements) => "" + diff --git a/src/plugins/userMessagesPronouns/index.ts b/src/plugins/userMessagesPronouns/index.ts index 1699251e..9eaab235 100644 --- a/src/plugins/userMessagesPronouns/index.ts +++ b/src/plugins/userMessagesPronouns/index.ts @@ -42,13 +42,6 @@ export default definePlugin({ { find: '="SYSTEM_TAG"', replacement: [ - { - // Add next to username (compact mode) - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\),(?=\i)/g, - replace: "$&$self.CompactPronounsChatComponentWrapper(arguments[0]),", - noWarn: true - }, { // Add next to username (compact mode) match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\)\),(?=\i)/g, diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index afd9d48c..2cc09fb6 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -194,12 +194,6 @@ export default definePlugin({ { find: ".overlay:void 0,status:", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/, - replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},", - noWarn: true - }, { match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",.{0,100}className:\i,/, replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},",