From 52f8a85ab9fbc7f802318147c7618391ff8b0e13 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 14 Apr 2024 14:25:05 +0200 Subject: [PATCH 1/9] fix(FavoriteEmojiFirst): don't lower suggestion count on hover --- src/plugins/favEmojiFirst/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/favEmojiFirst/index.ts b/src/plugins/favEmojiFirst/index.ts index f34b13884..afc72a1d2 100644 --- a/src/plugins/favEmojiFirst/index.ts +++ b/src/plugins/favEmojiFirst/index.ts @@ -83,6 +83,6 @@ export default definePlugin({ if (!aIsFavorite && bIsFavorite) return 1; return 0; - }).slice(0, query.results.emojis.sliceTo ?? 10); + }).slice(0, query.results.emojis.sliceTo ?? Infinity); } }); From 356a2c290dfcd9a9d757a3d59989ee28ae8b1b49 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Wed, 17 Apr 2024 03:10:15 +0700 Subject: [PATCH 2/9] fix: RoleColorEverywhere, PictureInPicture, NoMosaic (#2356) --- src/plugins/noMosaic/index.ts | 69 ++--------------------- src/plugins/noMosaic/styles.css | 8 --- src/plugins/pictureInPicture/index.tsx | 6 +- src/plugins/roleColorEverywhere/index.tsx | 2 +- 4 files changed, 10 insertions(+), 75 deletions(-) delete mode 100644 src/plugins/noMosaic/styles.css diff --git a/src/plugins/noMosaic/index.ts b/src/plugins/noMosaic/index.ts index 802f65e51..4715bde5c 100644 --- a/src/plugins/noMosaic/index.ts +++ b/src/plugins/noMosaic/index.ts @@ -5,15 +5,9 @@ */ import { definePluginSettings } from "@api/Settings"; -import { disableStyle, enableStyle } from "@api/Styles"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import style from "./styles.css?managed"; - -const MAX_WIDTH = 550; -const MAX_HEIGHT = 350; - const settings = definePluginSettings({ inlineVideo: { description: "Play videos without carousel modal", @@ -33,15 +27,11 @@ export default definePlugin({ patches: [ { - find: ".oneByTwoLayoutThreeGrid", - replacement: [{ - match: /mediaLayoutType:\i\.\i\.MOSAIC/, - replace: "mediaLayoutType:'RESPONSIVE'", - }, - { - match: /null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/, - replace: '"INVALID"', - }] + find: "isGroupableMedia:function()", + replacement: { + match: /=>"IMAGE"===\i\|\|"VIDEO"===\i;/, + replace: "=>false;" + } }, { find: "renderAttachments(", @@ -51,52 +41,5 @@ export default definePlugin({ replace: "$&$1.content_type?.startsWith('image/')&&" } }, - { - find: "Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT", - replacement: [{ - match: /\i===\i\.\i\.MOSAIC/, - replace: "true" - }, - { - match: /\i!==\i\.\i\.MOSAIC/, - replace: "false" - }] - }, - { - find: ".messageAttachment,", - replacement: { - match: /\{width:\i,height:\i\}=(\i).*?(?=className:\i\(\)\(\i\.messageAttachment,)/, - replace: "$&style:$self.style($1)," - } - } - ], - - style({ width, height }) { - if (!width || !height) return {}; - - if (width > MAX_WIDTH || height > MAX_HEIGHT) { - if (width / height > MAX_WIDTH / MAX_HEIGHT) { - height = Math.ceil(MAX_WIDTH / (width / height)); - width = MAX_WIDTH; - } else { - width = Math.ceil(MAX_HEIGHT * (width / height)); - height = MAX_HEIGHT; - } - } - - return { - maxWidth: width, - width: "100%", - aspectRatio: `${width} / ${height}` - }; - - }, - - start() { - enableStyle(style); - }, - - stop() { - disableStyle(style); - } + ] }); diff --git a/src/plugins/noMosaic/styles.css b/src/plugins/noMosaic/styles.css deleted file mode 100644 index 3a8a8e464..000000000 --- a/src/plugins/noMosaic/styles.css +++ /dev/null @@ -1,8 +0,0 @@ -[class^="nonMediaAttachmentsContainer_"] [class*="messageAttachment_"] { - position: relative; -} - -[class^="nonMediaAttachmentsContainer_"], -[class^="nonMediaAttachmentItem_"]:has([class^="messageAttachment_"][style^="max-width"]) { - width: 100%; -} diff --git a/src/plugins/pictureInPicture/index.tsx b/src/plugins/pictureInPicture/index.tsx index ca766affc..0a22f06db 100644 --- a/src/plugins/pictureInPicture/index.tsx +++ b/src/plugins/pictureInPicture/index.tsx @@ -10,7 +10,7 @@ import { definePluginSettings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { React, Tooltip } from "@webpack/common"; +import { Tooltip } from "@webpack/common"; const settings = definePluginSettings({ loop: { @@ -28,9 +28,9 @@ export default definePlugin({ settings, patches: [ { - find: ".nonMediaAttachment]", + find: ".nonMediaMosaicItem]", replacement: { - match: /\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/, + match: /\.nonMediaMosaicItem\]:!(\i).{0,10}children:\[(\S)/, replace: "$&,$1&&$2&&$self.renderPiPButton()," }, }, diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index b421eb7fa..6d53906f8 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -94,7 +94,7 @@ export default definePlugin({ find: "renderPrioritySpeaker", replacement: [ { - match: /renderName\(\).{0,100}speaking:.{50,100}jsx.{5,10}{/, + match: /renderName\(\).{0,100}speaking:.{50,150}"div",{/, replace: "$&...$self.getVoiceProps(this.props)," } ], From 3a79e41d67fd03946d3234c611b3b63e8c0f86c8 Mon Sep 17 00:00:00 2001 From: Elvyra <88881326+EdVraz@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:11:25 +0200 Subject: [PATCH 3/9] fix MessageLogger (#2358) --- src/plugins/messageLogger/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index 8a1e23912..c8b464391 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -337,12 +337,12 @@ export default definePlugin({ { // Attachment renderer // Module 96063 - find: ".removeAttachmentHoverButton", + find: ".removeMosaicItemHoverButton", group: true, replacement: [ { - match: /(className:\i,attachment:\i),/, - replace: "$1,attachment: {deleted}," + match: /(className:\i,item:\i),/, + replace: "$1,item: deleted," }, { match: /\[\i\.obscured\]:.+?,/, From 23b0841cc759999177f1bef579ebb11a46da3375 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 17 Apr 2024 04:44:42 +0200 Subject: [PATCH 4/9] fix ShowConnections --- src/plugins/customRPC/index.tsx | 3 +-- src/plugins/showConnections/index.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/customRPC/index.tsx b/src/plugins/customRPC/index.tsx index e70f8c908..35fb64d1c 100644 --- a/src/plugins/customRPC/index.tsx +++ b/src/plugins/customRPC/index.tsx @@ -27,7 +27,6 @@ import { ApplicationAssetUtils, FluxDispatcher, Forms, GuildStore, React, Select const ActivityComponent = findComponentByCodeLazy("onOpenGameProfile"); const ActivityClassName = findByPropsLazy("activity", "buttonColor"); -const Colors = findByPropsLazy("profileColors"); async function getApplicationAsset(key: string): Promise { if (/https?:\/\/(cdn|media)\.discordapp\.(com|net)\/attachments\//.test(key)) return "mp:" + key.replace(/https?:\/\/(cdn|media)\.discordapp\.(com|net)\//, ""); @@ -406,7 +405,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] && any = findByCodeLazy(',"--profile-gradient-primary-color"'); +const getTheme: (user: User, displayProfile: any) => any = findByCodeLazy('--profile-gradient-primary-color":'); const enum Spacing { COMPACT, From 538b87062a9f45ab88e4acb54e33ef0e48159be8 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 17 Apr 2024 04:44:56 +0200 Subject: [PATCH 5/9] bump to v1.7.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75ef41e50..723a40cb0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.7.6", + "version": "1.7.7", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": { From 89c82e2cd173b26b0eee938022afad5684e174cd Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 17 Apr 2024 23:42:56 +0200 Subject: [PATCH 6/9] 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 569c3f0ac..1aea0d6ee 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 7/9] 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 ca6122927..d70c09315 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 8/9] 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 35fb64d1c..334372e38 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 9/9] bump to v1.7.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 723a40cb0..776affcda 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": {