diff --git a/package.json b/package.json index 75ef41e50..776affcda 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.7.6", + "version": "1.7.8", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": { 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),$&" diff --git a/src/plugins/customRPC/index.tsx b/src/plugins/customRPC/index.tsx index e70f8c908..334372e38 100644 --- a/src/plugins/customRPC/index.tsx +++ b/src/plugins/customRPC/index.tsx @@ -22,12 +22,12 @@ 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"); -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)\//, ""); @@ -393,6 +393,8 @@ export default definePlugin({ settingsAboutComponent: () => { const activity = useAwaiter(createActivity); + const { profileThemeStyle } = useProfileThemeStyle({}); + return ( <> @@ -406,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] && "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)," } ], diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx index 83600e867..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; }) =>