From 89c82e2cd173b26b0eee938022afad5684e174cd Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 17 Apr 2024 23:42:56 +0200 Subject: [PATCH 1/8] fix settings patch --- src/plugins/_core/settings.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 569c3f0a..1aea0d6e 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -45,14 +45,14 @@ export default definePlugin({ replacement: { get match() { switch (Settings.plugins.Settings.settingsLocation) { - case "top": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.USER_SETTINGS\}/; - case "aboveNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.BILLING_SETTINGS\}/; - case "belowNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.APP_SETTINGS\}/; + case "top": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.USER_SETTINGS/; + case "aboveNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.BILLING_SETTINGS/; + case "belowNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.APP_SETTINGS/; case "belowActivity": return /(?<=\{section:(\i\.\i)\.DIVIDER},)\{section:"changelog"/; case "bottom": return /\{section:(\i\.\i)\.CUSTOM,\s*element:.+?}/; case "aboveActivity": default: - return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.ACTIVITY_SETTINGS\}/; + return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.ACTIVITY_SETTINGS/; } }, replace: "...$self.makeSettingsCategories($1),$&" From 0c6ddf80e8e90b33e89684b61e73710a28a99019 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 18 Apr 2024 00:26:09 +0200 Subject: [PATCH 2/8] ShowConnections: fix icon theme logic --- src/plugins/showConnections/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx index ca612292..d70c0931 100644 --- a/src/plugins/showConnections/index.tsx +++ b/src/plugins/showConnections/index.tsx @@ -35,7 +35,7 @@ const Section = findComponentByCodeLazy(".lastSection", "children:"); const ThemeStore = findStoreLazy("ThemeStore"); const platformHooks: { useLegacyPlatformType(platform: string): string; } = findByPropsLazy("useLegacyPlatformType"); const platforms: { get(type: string): ConnectionPlatform; } = findByPropsLazy("isSupported", "getByUrl"); -const getTheme: (user: User, displayProfile: any) => any = findByCodeLazy('--profile-gradient-primary-color":'); +const getProfileThemeProps = findByCodeLazy(".getPreviewThemeColors", "primaryColor:"); const enum Spacing { COMPACT, @@ -74,8 +74,8 @@ interface ConnectionPlatform { icon: { lightSVG: string, darkSVG: string; }; } -const profilePopoutComponent = ErrorBoundary.wrap(({ user, displayProfile }: { user: User, displayProfile; }) => - +const profilePopoutComponent = ErrorBoundary.wrap((props: { user: User, displayProfile; }) => + ); const profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) => From 82d914e62f76e2cc81dc812d0e6f249d293b983f Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 18 Apr 2024 00:40:09 +0200 Subject: [PATCH 3/8] CustomRPC: fix preview styles --- src/plugins/customRPC/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/customRPC/index.tsx b/src/plugins/customRPC/index.tsx index 35fb64d1..334372e3 100644 --- a/src/plugins/customRPC/index.tsx +++ b/src/plugins/customRPC/index.tsx @@ -22,9 +22,10 @@ import { Devs } from "@utils/constants"; import { isTruthy } from "@utils/guards"; import { useAwaiter } from "@utils/react"; import definePlugin, { OptionType } from "@utils/types"; -import { findByPropsLazy, findComponentByCodeLazy } from "@webpack"; +import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy } from "@webpack"; import { ApplicationAssetUtils, FluxDispatcher, Forms, GuildStore, React, SelectedChannelStore, SelectedGuildStore, UserStore } from "@webpack/common"; +const useProfileThemeStyle = findByCodeLazy("profileThemeStyle:", "--profile-gradient-primary-color"); const ActivityComponent = findComponentByCodeLazy("onOpenGameProfile"); const ActivityClassName = findByPropsLazy("activity", "buttonColor"); @@ -392,6 +393,8 @@ export default definePlugin({ settingsAboutComponent: () => { const activity = useAwaiter(createActivity); + const { profileThemeStyle } = useProfileThemeStyle({}); + return ( <> @@ -405,7 +408,7 @@ export default definePlugin({ If you want to use image link, download your image and reupload the image to Imgur and get the image link by right-clicking the image and select "Copy image address". -
+
{activity[0] && Date: Thu, 18 Apr 2024 00:53:28 +0200 Subject: [PATCH 4/8] bump to v1.7.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 723a40cb..776affcd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.7.7", + "version": "1.7.8", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": { From 5aa19bbf49839c31f4a15fa96994c3fb2ce22e31 Mon Sep 17 00:00:00 2001 From: Elvyra <88881326+EdVraz@users.noreply.github.com> Date: Sat, 20 Apr 2024 11:18:03 +0200 Subject: [PATCH 5/8] fix ValidUser (#2369) --- src/plugins/validUser/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/validUser/index.tsx b/src/plugins/validUser/index.tsx index b0c77cb4..dafa7bc9 100644 --- a/src/plugins/validUser/index.tsx +++ b/src/plugins/validUser/index.tsx @@ -111,7 +111,7 @@ function MentionWrapper({ data, UserMention, RoleMention, parse, props }: Mentio export default definePlugin({ name: "ValidUser", - description: "Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)", + description: "Fix mentions for unknown users showing up as '@unknown-user' (hover over a mention to fix it)", authors: [Devs.Ven], tags: ["MentionCacheFix"], @@ -119,7 +119,7 @@ export default definePlugin({ find: 'className:"mention"', replacement: { // mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention() - match: /react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/, + match: /react(?=\(\i,\i,\i\).{0,50}return null==.{0,70}\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/, // react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc replace: "react:(...args)=>$self.renderMention($1,$2,...args),originalReact" } From 87ef214810e561cd37649d3b4eec4dbbbd7e018d Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 20 Apr 2024 11:29:15 +0200 Subject: [PATCH 6/8] RoleColorEverywhere: fix chat mentions --- src/plugins/roleColorEverywhere/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index 6d53906f..71c291fe 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -50,7 +50,7 @@ export default definePlugin({ patches: [ // Chat Mentions { - find: "CLYDE_AI_MENTION_COLOR:null,", + find: 'location:"UserMention', replacement: [ { match: /user:(\i),channel:(\i).{0,400}?"@"\.concat\(.+?\)/, From 74df53e7c8d81abf77ca67ab7432a5a8bfc8e4f6 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 20 Apr 2024 11:37:22 +0200 Subject: [PATCH 7/8] ValidUser: fix not working for @unknown-user mentions --- src/plugins/validUser/index.tsx | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/plugins/validUser/index.tsx b/src/plugins/validUser/index.tsx index dafa7bc9..d3decd94 100644 --- a/src/plugins/validUser/index.tsx +++ b/src/plugins/validUser/index.tsx @@ -115,15 +115,24 @@ export default definePlugin({ authors: [Devs.Ven], tags: ["MentionCacheFix"], - patches: [{ - find: 'className:"mention"', - replacement: { - // mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention() - match: /react(?=\(\i,\i,\i\).{0,50}return null==.{0,70}\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/, - // react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc - replace: "react:(...args)=>$self.renderMention($1,$2,...args),originalReact" + patches: [ + { + find: 'className:"mention"', + replacement: { + // mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention() + match: /react(?=\(\i,\i,\i\).{0,50}return null==.{0,70}\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/, + // react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc + replace: "react:(...args)=>$self.renderMention($1,$2,...args),originalReact" + } + }, + { + find: "unknownUserMentionPlaceholder:", + replacement: { + match: /unknownUserMentionPlaceholder:/, + replace: "$&false&&" + } } - }], + ], renderMention(RoleMention, UserMention, data, parse, props) { return ( From 0bebc85b0dc08c9345210499dc9d24dd14c64ac0 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 20 Apr 2024 11:50:28 +0200 Subject: [PATCH 8/8] fix FriendsSince on canary --- src/plugins/friendsSince/index.tsx | 16 +++++++++++++--- src/webpack/webpack.ts | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index dd37137a..69d8e739 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -7,12 +7,22 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import { getCurrentChannel } from "@utils/discord"; +import { makeLazy } from "@utils/lazy"; import definePlugin from "@utils/types"; -import { findByPropsLazy } from "@webpack"; +import { filters, find, findByPropsLazy, handleModuleNotFound } from "@webpack"; import { React, RelationshipStore } from "@webpack/common"; const { Heading, Text } = findByPropsLazy("Heading", "Text"); -const container = findByPropsLazy("memberSinceContainer"); +// Workaround for module differing on stable & canary +// FIXME: remove once merged into stable +const getMemberSinceContainer = makeLazy(() => { + for (const name of ["memberSinceWrapper", "memberSinceContainer"]) { + const mod = find(filters.byProps(name), { isIndirect: true }); + if (mod) return mod[name]; + } + handleModuleNotFound("findByProps", "memberSinceWrapper/memberSinceContainer"); + return ""; +}); const { getCreatedAtDate } = findByPropsLazy("getCreatedAtDate"); const clydeMoreInfo = findByPropsLazy("clydeMoreInfo"); const locale = findByPropsLazy("getLocale"); @@ -49,7 +59,7 @@ export default definePlugin({ Friends Since -
+
{!!getCurrentChannel()?.guild_id && (