From c73f49a08f2fad895fa89afdfb75cffe90a08174 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:56:13 -0500 Subject: [PATCH 1/8] Fix BetterInvites --- src/equicordplugins/betterInvites/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/equicordplugins/betterInvites/index.tsx b/src/equicordplugins/betterInvites/index.tsx index d72cbb74..1e12adad 100644 --- a/src/equicordplugins/betterInvites/index.tsx +++ b/src/equicordplugins/betterInvites/index.tsx @@ -44,7 +44,7 @@ export default definePlugin({ replace: ",($1||((!$1)&&arguments[0].invite.expires_at)) && $2$self.RenderTip($1, $3, arguments[0].invite.expires_at)" }, { - match: /(\.jsx\)\(\i.\i.Info,{.+onClick:\i\?.{0,5}:null)/, + match: /(\.jsx\)\(\i.\i.Info,{.+onClick:\i)/, replace: "$& || $self.Lurkable(arguments[0].invite.guild.id, arguments[0].invite.guild.features)" }, { @@ -73,4 +73,3 @@ export default definePlugin({ }, startAt: StartAt.WebpackReady }); - From 22bb603da1c8551604c30a7e63e269f0b245ac27 Mon Sep 17 00:00:00 2001 From: mochie Date: Thu, 27 Feb 2025 00:42:02 +0100 Subject: [PATCH 2/8] fix white typing indicators in servers (#166) --- src/plugins/typingTweaks/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index 69226e1c..85580310 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -60,8 +60,8 @@ interface Props { function typingUserColor(guildId: string, userId: string) { if (!settings.store.showRoleColors) return; - if (Settings.plugins.CustomUserColors.enabled) return getCustomColorString(userId, true); - return GuildMemberStore.getMember(guildId, userId)?.colorString; + const customColor = Settings.plugins.CustomUserColors.enabled ? getCustomColorString(userId, true) : null; + return customColor ?? GuildMemberStore.getMember(guildId, userId)?.colorString; } const TypingUser = ErrorBoundary.wrap(function ({ user, guildId }: Props) { From 14bbde33cb1b7da0268126ac7ed85f26591f2fe2 Mon Sep 17 00:00:00 2001 From: panbread <93918332+Panniku@users.noreply.github.com> Date: Wed, 26 Feb 2025 21:50:23 +0400 Subject: [PATCH 3/8] Drop DoNotLeak + Extras Co-Authored-By: thororen1234 Co-Authored-By: thororen <78185467+thororen1234@users.noreply.github.com> Co-Authored-By: sadan4 <117494111+sadan4@users.noreply.github.com> Co-Authored-By: ynot01 Co-Authored-By: MrDiamondDog <84212701+MrDiamondDog@users.noreply.github.com> Co-Authored-By: Crxaw <48805031+sitescript@users.noreply.github.com> --- README.md | 5 +- .../customUserColors/index.tsx | 4 +- src/equicordplugins/doNotLeak/index.ts | 85 ------------- src/equicordplugins/doNotLeak/style.ts | 116 ------------------ src/equicordplugins/hideMessage/index.tsx | 6 +- src/equicordplugins/statsfm/index.tsx | 7 +- .../unreadBadgeCount/index.tsx | 8 +- .../vcNarratorCustom/index.tsx | 2 +- src/plugins/_core/supportHelper.tsx | 6 +- src/plugins/gameActivityToggle/index.tsx | 2 +- src/plugins/hideAttachments/index.tsx | 5 +- src/plugins/lastfm/index.tsx | 7 +- .../translate/TranslationAccessory.tsx | 2 +- src/plugins/translate/index.tsx | 9 ++ src/plugins/translate/settings.ts | 5 + src/plugins/vcDoubleClick/index.ts | 20 ++- src/plugins/vcNarrator/index.tsx | 2 +- 17 files changed, 68 insertions(+), 223 deletions(-) delete mode 100644 src/equicordplugins/doNotLeak/index.ts delete mode 100644 src/equicordplugins/doNotLeak/style.ts diff --git a/README.md b/README.md index e8b71655..5393f9e3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch ### Extra included plugins
-151 additional plugins +150 additional plugins ### All Platforms - AllCallTimers by MaxHerbold & D3SOX @@ -45,7 +45,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - DeadMembers by Kyuuhachi - Demonstration by Samwich - DisableCameras by Joona -- DoNotLeak by Perny - DontFilterMe by Samwich - EmojiDumper by Cortex, Samwich, Woosh - Encryptcord by Inbestigator @@ -190,7 +189,7 @@ Linux - [AUR](https://aur.archlinux.org/packages?O=0&K=equicord) ```shell sh -c "$(curl -sS https://raw.githubusercontent.com/Equicord/Equicord/refs/heads/main/misc/install.sh)" -``` +``` ## Installing Equicord Devbuild ### Dependencies diff --git a/src/equicordplugins/customUserColors/index.tsx b/src/equicordplugins/customUserColors/index.tsx index 78d9c31a..1136829d 100644 --- a/src/equicordplugins/customUserColors/index.tsx +++ b/src/equicordplugins/customUserColors/index.tsx @@ -109,11 +109,11 @@ export default definePlugin({ }, colorIfServer(a: any): string | undefined { - const roleColor = a.author?.colorString ?? "inherit"; + const roleColor = a.author?.colorString; if (a?.channel?.guild_id && !settings.store.colorInServers) return roleColor; const color = getCustomColorString(a.message.author.id, true); - return color ?? roleColor; + return color ?? roleColor ?? undefined; } }); diff --git a/src/equicordplugins/doNotLeak/index.ts b/src/equicordplugins/doNotLeak/index.ts deleted file mode 100644 index 8c73fb53..00000000 --- a/src/equicordplugins/doNotLeak/index.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { definePluginSettings } from "@api/Settings"; -import { EquicordDevs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; - -import { getStyle } from "./style"; - -const settings = definePluginSettings({ - hoverToView: { - type: OptionType.BOOLEAN, - description: "When hovering over a message, show the contents.", - default: false, - onChange: () => { - console.log(settings.store.hoverToView); - updateClassList("hover-to-view", settings.store.hoverToView); - }, - }, - keybind: { - type: OptionType.STRING, - description: "The keybind to show the contents of a message.", - default: "Insert", - restartNeeded: false, - }, - enableForStream: { - type: OptionType.BOOLEAN, - description: "Blur all messages in streamer mode.", - default: false, - onChange: () => { - console.log(settings.store.enableForStream); - updateClassList( - "hide-in-streamer-mode", - settings.store.enableForStream - ); - }, - }, -}); - -export default definePlugin({ - name: "DoNotLeak", - tags: ["DontLeak"], - description: "Hide all message contents and attachments when you're streaming or sharing your screen.", - authors: [EquicordDevs.Perny], - settings, - start() { - const styles = getStyle(); - - const style = document.createElement("style"); - style.setAttribute("id", "vc-dont-leak-style"); - style.innerHTML = styles; - document.head.appendChild(style); - - document.addEventListener("keyup", keyUpHandler); - document.addEventListener("keydown", keyDownHandler); - updateClassList("hover-to-view", settings.store.hoverToView); - updateClassList("hide-in-streamer-mode", settings.store.enableForStream); - }, - stop() { - document.removeEventListener("keyup", keyUpHandler); - document.removeEventListener("keydown", keyDownHandler); - document.getElementById("vc-dont-leak-style")?.remove(); - }, -}); - -function updateClassList(className, condition) { - if (condition) { - document.body.classList.add(`vc-dnl-${className}`); - return; - } - document.body.classList.remove(`vc-dnl-${className}`); -} - -function keyUpHandler(e: KeyboardEvent) { - if (e.key !== settings.store.keybind) return; - updateClassList("show-messages", false); -} - -function keyDownHandler(e: KeyboardEvent) { - if (e.key !== settings.store.keybind) return; - updateClassList("show-messages", true); -} diff --git a/src/equicordplugins/doNotLeak/style.ts b/src/equicordplugins/doNotLeak/style.ts deleted file mode 100644 index e0443616..00000000 --- a/src/equicordplugins/doNotLeak/style.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { findByProps } from "@webpack"; - -const CssFormatCode: string = `body:has( - div.{sidebar} - > section - div.{wrapper} - div.{actionButtons} - > button:nth-child(2).{buttonActive} -) -.{messageContent} { -filter: blur(12px); -} - -body:has( - div.{sidebar} - > section - div.{wrapper} - div.{actionButtons} - > button:nth-child(2).{buttonActive} -) -.{visualMediaItemContainer} { -filter: blur(50px) brightness(0.1); -} - -body:has( - div.{sidebar} - > section - div.{wrapper} - div.{actionButtons} - > button:nth-child(2).{buttonActive} -) -.{embedWrapper} { -filter: blur(50px); -} - -body.vc-dnl-hide-in-streamer-mode:has(.{notice}.{colorStreamerMode}) -.{visualMediaItemContainer} { -filter: blur(50px) brightness(0.1); -} - -body.vc-dnl-hide-in-streamer-mode:has(.{notice}.{colorStreamerMode}) -.{messageContent} { -filter: blur(12px); -} - -body.vc-dnl-hide-in-streamer-mode:has(.{notice}.{colorStreamerMode}) -.{embedWrapper} { -filter: blur(50px); -} - -body.vc-dnl-show-messages .{visualMediaItemContainer} { -filter: blur(0px) brightness(1) !important; -} - -body.vc-dnl-show-messages .{messageContent} { -filter: blur(0px) !important; -} - -body.vc-dnl-show-messages .{embedWrapper} { -filter: blur(0px) !important; -} - -body.vc-dnl-hover-to-view .{messageContent}:hover { -filter: blur(0px) brightness(1) !important; -} - -body.vc-dnl-hover-to-view .{embedWrapper}:hover { -filter: blur(0px) brightness(1) !important; -} - -body.vc-dnl-hover-to-view .{visualMediaItemContainer}:hover { -filter: blur(0px) brightness(1) !important; -}`; - -/* -[ - "sidebar", - "wrapper", - "actionButtons", - "buttonActive", - "messageContent", - "visualMediaItemContainer", - "embedWrapper", - "notice", - "colorStreamerMode", -] -*/ - -export function getStyle(): string { - const messageContent = findByProps("messageContent", "titleCase"); // ["messageContent","wrapper"] - const embedWrapper = findByProps("embedWrapper"); - const mediaContainer = findByProps("visualMediaItemContainer"); - const notice = findByProps("colorStreamerMode", "notice"); - const actionBar = findByProps("actionButtons", "buttonActive", "wrapper"); - const sidebar = findByProps("sidebar", "panels"); - const Classes = Object.assign( - {}, - actionBar, - notice, - mediaContainer, - embedWrapper, - messageContent, - sidebar - ); - let CssCode = CssFormatCode; - for (const className in Classes) { - CssCode = CssCode.replaceAll(`{${className}}`, Classes[className]); - } - return CssCode; -} diff --git a/src/equicordplugins/hideMessage/index.tsx b/src/equicordplugins/hideMessage/index.tsx index f0961cef..21265f17 100644 --- a/src/equicordplugins/hideMessage/index.tsx +++ b/src/equicordplugins/hideMessage/index.tsx @@ -32,7 +32,7 @@ const patchMessageContextMenu: NavContextMenuPatchCallback = (children, { messag const { deleted, id, channel_id } = message; if (deleted || message.state !== "SENT") return; - const isHidden = hiddenMessages?.has(id) ?? false; + const isHidden = hiddenMessages?.has(id) || false; if (isHidden) { return children.push( { }; export const revealMessage = (id: string) => { - const isHidden = hiddenMessages?.has(id) ?? false; + const isHidden = hiddenMessages?.has(id) || false; if (isHidden) { hiddenMessages.delete(id); buildCss(); @@ -149,7 +149,7 @@ export default definePlugin({ } addMessageAccessory("vc-hide-message", ({ message }) => { - const isHidden = hiddenMessages?.has(message.id) ?? false; + const isHidden = hiddenMessages?.has(message.id) || false; if (isHidden && settings.store.showNotice) return ; return null; }); diff --git a/src/equicordplugins/statsfm/index.tsx b/src/equicordplugins/statsfm/index.tsx index 06d6d038..280dfc84 100644 --- a/src/equicordplugins/statsfm/index.tsx +++ b/src/equicordplugins/statsfm/index.tsx @@ -225,6 +225,11 @@ const settings = definePluginSettings({ description: "Show the Stats.fm next to the albums cover", type: OptionType.BOOLEAN, default: true, + }, + alwaysHideArt: { + description: "Disable downloading album art", + type: OptionType.BOOLEAN, + default: false, } }); @@ -295,7 +300,7 @@ export default definePlugin({ }, getLargeImage(track: TrackData): string | undefined { - if (track.imageUrl && !track.imageUrl.includes(placeholderId)) + if (!settings.store.alwaysHideArt && track.imageUrl && !track.imageUrl.includes(placeholderId)) return track.imageUrl; if (settings.store.missingArt === "placeholder") diff --git a/src/equicordplugins/unreadBadgeCount/index.tsx b/src/equicordplugins/unreadBadgeCount/index.tsx index 05cde5e3..d2dd9fcd 100644 --- a/src/equicordplugins/unreadBadgeCount/index.tsx +++ b/src/equicordplugins/unreadBadgeCount/index.tsx @@ -105,6 +105,10 @@ export default definePlugin({ if (unreadCount >= 100) { paddingValue = 4; } else if (unreadCount >= 10) { paddingValue = 2; } else paddingValue = 0; + let widthValue = 16; + if (unreadCount >= 100) { widthValue = 30; } else + if (unreadCount >= 10) { widthValue = 22; } else + widthValue = 16; return ( = 10 ? 22 : 16 - } + width={widthValue} padding={paddingValue} /> ); diff --git a/src/equicordplugins/vcNarratorCustom/index.tsx b/src/equicordplugins/vcNarratorCustom/index.tsx index 998a325c..9e9e9b77 100644 --- a/src/equicordplugins/vcNarratorCustom/index.tsx +++ b/src/equicordplugins/vcNarratorCustom/index.tsx @@ -211,7 +211,7 @@ const settings = definePluginSettings({ muteMessage: { type: OptionType.STRING, description: "Mute Message (only self for now)", - default: "{{DISPLAY_NAME}} Muted", + default: "{{DISPLAY_NAME}} muted", }, unmuteMessage: { type: OptionType.STRING, diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index d2fe060b..cd3372de 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -86,7 +86,11 @@ async function generateDebugInfoMessage() { `v${VERSION} • [${gitHash}]()` + `${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat("en-GB", { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`, Client: `${RELEASE_CHANNEL} ~ ${client}`, - Platform: window.navigator.platform + Platform: typeof DiscordNative !== "undefined" ? + `${DiscordNative.process.platform === "darwin" ? + (DiscordNative.process.arch === "arm64" ? "MacSilicon" : "MacIntel") : + (DiscordNative.process.platform === "win32" && DiscordNative.process.arch === "x64" ? "Windows" : DiscordNative.process.platform)}` : + window.navigator.platform }; if (IS_DISCORD_DESKTOP) { diff --git a/src/plugins/gameActivityToggle/index.tsx b/src/plugins/gameActivityToggle/index.tsx index 37d0ca4c..c1301411 100644 --- a/src/plugins/gameActivityToggle/index.tsx +++ b/src/plugins/gameActivityToggle/index.tsx @@ -95,7 +95,7 @@ export default definePlugin({ { find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}", replacement: { - match: /this\.renderNameZone\(\).+?children:\[/, + match: /className:\i\.buttons,.{0,50}children:\[/, replace: "$&$self.GameActivityToggleButton()," } } diff --git a/src/plugins/hideAttachments/index.tsx b/src/plugins/hideAttachments/index.tsx index 58c5af6a..26f6a47a 100644 --- a/src/plugins/hideAttachments/index.tsx +++ b/src/plugins/hideAttachments/index.tsx @@ -63,7 +63,7 @@ export default definePlugin({ if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length && !hasAttachmentsInShapshots) return null; - const isHidden = hiddenMessages?.has(msg.id) ?? false; + const isHidden = hiddenMessages?.has(msg.id) || false; return { label: isHidden ? "Show Media" : "Hide Media", @@ -93,7 +93,8 @@ export default definePlugin({ }, shouldHide(messageId: string) { - return hiddenMessages?.has(messageId) ?? false; + return hiddenMessages?.has(messageId) || false; + }, async toggleHide(channelId: string, messageId: string) { diff --git a/src/plugins/lastfm/index.tsx b/src/plugins/lastfm/index.tsx index e4e9c209..75d9c7c3 100644 --- a/src/plugins/lastfm/index.tsx +++ b/src/plugins/lastfm/index.tsx @@ -197,6 +197,11 @@ const settings = definePluginSettings({ description: "show the Last.fm logo by the album cover", type: OptionType.BOOLEAN, default: true, + }, + alwaysHideArt: { + description: "Disable downloading album art", + type: OptionType.BOOLEAN, + default: false, } }); @@ -279,7 +284,7 @@ export default definePlugin({ }, getLargeImage(track: TrackData): string | undefined { - if (track.imageUrl && !track.imageUrl.includes(placeholderId)) + if (!settings.store.alwaysHideArt && track.imageUrl && !track.imageUrl.includes(placeholderId)) return track.imageUrl; if (settings.store.missingArt === "placeholder") diff --git a/src/plugins/translate/TranslationAccessory.tsx b/src/plugins/translate/TranslationAccessory.tsx index 9b6393cc..db9461d8 100644 --- a/src/plugins/translate/TranslationAccessory.tsx +++ b/src/plugins/translate/TranslationAccessory.tsx @@ -57,7 +57,7 @@ export function TranslationAccessory({ message }: { message: Message; }) { {Parser.parse(translation.text)} - {" "} +
(translated from {translation.sourceLanguage} - setTranslation(undefined)} />)
); diff --git a/src/plugins/translate/index.tsx b/src/plugins/translate/index.tsx index 363897d1..975f67ba 100644 --- a/src/plugins/translate/index.tsx +++ b/src/plugins/translate/index.tsx @@ -22,12 +22,21 @@ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/Co import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; import { ChannelStore, Menu } from "@webpack/common"; +import { Message } from "discord-types/general"; import { settings } from "./settings"; import { setShouldShowTranslateEnabledTooltip, TranslateChatBarIcon, TranslateIcon } from "./TranslateIcon"; import { handleTranslate, TranslationAccessory } from "./TranslationAccessory"; import { translate } from "./utils"; +interface IMessageCreate { + type: "MESSAGE_CREATE"; + optimistic: boolean; + isPushNotification: boolean; + channelId: string; + message: Message; +} + const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => { if (!message.content) return; diff --git a/src/plugins/translate/settings.ts b/src/plugins/translate/settings.ts index 916c70bd..404ccfbf 100644 --- a/src/plugins/translate/settings.ts +++ b/src/plugins/translate/settings.ts @@ -78,6 +78,11 @@ export const settings = definePluginSettings({ description: "Show a tooltip on the ChatBar button whenever a message is automatically translated", default: true }, + disableOnSameLanguage: { + type: OptionType.BOOLEAN, + description: "Disable auto translate if the current language doesnt change", + default: true + } }).withPrivateSettings<{ showAutoTranslateAlert: boolean; }>(); diff --git a/src/plugins/vcDoubleClick/index.ts b/src/plugins/vcDoubleClick/index.ts index 8d4cae6a..d9310f51 100644 --- a/src/plugins/vcDoubleClick/index.ts +++ b/src/plugins/vcDoubleClick/index.ts @@ -18,7 +18,7 @@ import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; -import { ChannelStore, SelectedChannelStore } from "@webpack/common"; +import { ChannelRouter, ChannelStore, SelectedChannelStore } from "@webpack/common"; const timers = {} as Record "" + `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})&&${onClick}()`, } + }, + // Voice channels in the active now section + { + find: ',["embedded_background"]', + replacement: { + // There are two onClick events for this section, one for the server icon, and another for the channel name + // The server icon takes you to the voice channel, but doesnt join it. The channel name joins the voice channel + match: /(?=children)(?<=selectVoiceChannel\((\i)\.id\).{0,100})/, + replace: "onClick:$self.goToChannel.bind(null,$1)," + } } ], + goToChannel(props: { id?: string; } | undefined) { + const { id } = props ?? {}; + if (!id) return console.error("No channel id found"); + ChannelRouter.transitionToChannel(id); + }, + shouldRunOnClick(e: MouseEvent, { channelId }) { const channel = ChannelStore.getChannel(channelId); if (!channel || ![2, 13].includes(channel.type)) return true; diff --git a/src/plugins/vcNarrator/index.tsx b/src/plugins/vcNarrator/index.tsx index 95be33be..56a2cb36 100644 --- a/src/plugins/vcNarrator/index.tsx +++ b/src/plugins/vcNarrator/index.tsx @@ -273,7 +273,7 @@ export default definePlugin({ muteMessage: { type: OptionType.STRING, description: "Mute Message (only self for now)", - default: "{{USER}} Muted" + default: "{{USER}} muted" }, unmuteMessage: { type: OptionType.STRING, From 5bf215546bf775b3cc9ea161efe024cdd1f3cfae Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 26 Feb 2025 19:45:30 -0500 Subject: [PATCH 4/8] Finish Purge For Merge --- src/plugins/translate/index.tsx | 9 --------- src/plugins/translate/settings.ts | 5 ----- 2 files changed, 14 deletions(-) diff --git a/src/plugins/translate/index.tsx b/src/plugins/translate/index.tsx index 975f67ba..363897d1 100644 --- a/src/plugins/translate/index.tsx +++ b/src/plugins/translate/index.tsx @@ -22,21 +22,12 @@ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/Co import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; import { ChannelStore, Menu } from "@webpack/common"; -import { Message } from "discord-types/general"; import { settings } from "./settings"; import { setShouldShowTranslateEnabledTooltip, TranslateChatBarIcon, TranslateIcon } from "./TranslateIcon"; import { handleTranslate, TranslationAccessory } from "./TranslationAccessory"; import { translate } from "./utils"; -interface IMessageCreate { - type: "MESSAGE_CREATE"; - optimistic: boolean; - isPushNotification: boolean; - channelId: string; - message: Message; -} - const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => { if (!message.content) return; diff --git a/src/plugins/translate/settings.ts b/src/plugins/translate/settings.ts index 404ccfbf..58042c5e 100644 --- a/src/plugins/translate/settings.ts +++ b/src/plugins/translate/settings.ts @@ -77,11 +77,6 @@ export const settings = definePluginSettings({ type: OptionType.BOOLEAN, description: "Show a tooltip on the ChatBar button whenever a message is automatically translated", default: true - }, - disableOnSameLanguage: { - type: OptionType.BOOLEAN, - description: "Disable auto translate if the current language doesnt change", - default: true } }).withPrivateSettings<{ showAutoTranslateAlert: boolean; From aab09ac249c388f73880a09c16f12d978de15883 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 27 Feb 2025 18:55:55 -0300 Subject: [PATCH 5/8] Fix ChatInputButtonAPI --- src/plugins/_api/chatButtons.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/_api/chatButtons.ts b/src/plugins/_api/chatButtons.ts index 184b0158..d4e1ea8b 100644 --- a/src/plugins/_api/chatButtons.ts +++ b/src/plugins/_api/chatButtons.ts @@ -17,7 +17,7 @@ export default definePlugin({ find: '"sticker")', replacement: { // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /return\((!)?\i\.\i(?:\|\||&&)(?=\(\i\.isDM.+?(\i)\.push)/, + match: /return\((!)?\i\.\i(?:\|\||&&)(?=\(.+?(\i)\.push)/, replace: (m, not, children) => not ? `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),true)&&` : `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),false)||` From 8f65d3cae97abb42097e2eb015a51fc4c6d5bc52 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 27 Feb 2025 21:05:43 -0300 Subject: [PATCH 6/8] ImageZoom: Fix for new media viewer --- src/plugins/imageZoom/index.tsx | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx index 934a5c77..1a17b616 100644 --- a/src/plugins/imageZoom/index.tsx +++ b/src/plugins/imageZoom/index.tsx @@ -165,8 +165,35 @@ export default definePlugin({ { find: ".contain,SCALE_DOWN:", replacement: { - match: /\.slide,\i\),/g, - replace: `$&id:"${ELEMENT_ID}",` + match: /imageClassName:/, + replace: `id:"${ELEMENT_ID}",$&` + } + }, + + { + find: ".dimensionlessImage,", + replacement: [ + { + match: /className:\i\.media,/, + replace: `id:"${ELEMENT_ID}",$&` + }, + { + // This patch needs to be above the next one as it uses the zoomed class as an anchor + match: /\.zoomed]:.+?,(?=children:)/, + replace: "$&onClick:()=>{}," + }, + { + match: /className:\i\(\)\(\i\.wrapper,.+?}\),/, + replace: "" + }, + ] + }, + // Make media viewer options not hide when zoomed in with the default Discord feature + { + find: '="FOCUS_SENSITIVE",', + replacement: { + match: /(?<=\.hidden]:)\i/, + replace: "false" } }, From e88af36be935c95c59d75a8e15998dd660ec4f0c Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Thu, 27 Feb 2025 19:32:09 -0500 Subject: [PATCH 7/8] ConsoleJanitor: Support allowing log levels (#3255) Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> --- .../consoleJanitor/{index.ts => index.tsx} | 68 +++++++++++++++++-- src/utils/types.ts | 9 ++- src/webpack/common/components.ts | 1 + src/webpack/common/types/components.d.ts | 32 ++++++++- 4 files changed, 102 insertions(+), 8 deletions(-) rename src/plugins/consoleJanitor/{index.ts => index.tsx} (68%) diff --git a/src/plugins/consoleJanitor/index.ts b/src/plugins/consoleJanitor/index.tsx similarity index 68% rename from src/plugins/consoleJanitor/index.ts rename to src/plugins/consoleJanitor/index.tsx index 34f5653c..5a3b3cd1 100644 --- a/src/plugins/consoleJanitor/index.ts +++ b/src/plugins/consoleJanitor/index.tsx @@ -5,8 +5,11 @@ */ import { definePluginSettings } from "@api/Settings"; +import { ErrorBoundary, Flex } from "@components/index"; import { Devs } from "@utils/constants"; -import definePlugin, { OptionType, StartAt } from "@utils/types"; +import { Margins } from "@utils/margins"; +import definePlugin, { defineDefault, OptionType, StartAt } from "@utils/types"; +import { Checkbox, Forms, Text } from "@webpack/common"; const Noop = () => { }; const NoopLogger = { @@ -24,6 +27,48 @@ const NoopLogger = { const logAllow = new Set(); +interface AllowLevels { + error: boolean; + warn: boolean; + trace: boolean; + log: boolean; + info: boolean; + debug: boolean; +} + +interface AllowLevelSettingProps { + settingKey: keyof AllowLevels; +} + +function AllowLevelSetting({ settingKey }: AllowLevelSettingProps) { + const { allowLevel } = settings.use(["allowLevel"]); + const value = allowLevel[settingKey]; + + return ( + settings.store.allowLevel[settingKey] = newValue} + size={20} + > + {settingKey[0].toUpperCase() + settingKey.slice(1)} + + ); +} + +const AllowLevelSettings = ErrorBoundary.wrap(() => { + return ( + + Filter List + Always allow loggers of these types + + {Object.keys(settings.store.allowLevel).map(key => ( + + ))} + + + ); +}); + const settings = definePluginSettings({ disableLoggers: { type: OptionType.BOOLEAN, @@ -45,6 +90,18 @@ const settings = definePluginSettings({ logAllow.clear(); newVal.split(";").map(x => x.trim()).forEach(logAllow.add.bind(logAllow)); } + }, + allowLevel: { + type: OptionType.COMPONENT, + component: AllowLevelSettings, + default: defineDefault({ + error: true, + warn: false, + trace: false, + log: false, + info: false, + debug: false + }) } }); @@ -61,8 +118,9 @@ export default definePlugin({ }, NoopLogger: () => NoopLogger, - shouldLog(logger: string) { - return logAllow.has(logger); + + shouldLog(logger: string, level: keyof AllowLevels) { + return logAllow.has(logger) || settings.store.allowLevel[level] === true; }, patches: [ @@ -136,13 +194,13 @@ export default definePlugin({ replace: "" } }, - // Patches discords generic logger function + // Patches Discord generic logger function { find: "Σ:", predicate: () => settings.store.disableLoggers, replacement: { match: /(?<=&&)(?=console)/, - replace: "$self.shouldLog(arguments[0])&&" + replace: "$self.shouldLog(arguments[0],arguments[1])&&" } }, { diff --git a/src/utils/types.ts b/src/utils/types.ts index 6a791c86..3ad63ea1 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -26,7 +26,7 @@ import { MessageDecorationFactory } from "@api/MessageDecorations"; import { MessageClickListener, MessageEditListener, MessageSendListener } from "@api/MessageEvents"; import { MessagePopoverButtonFactory } from "@api/MessagePopover"; import { FluxEvents } from "@webpack/types"; -import { JSX } from "react"; +import { ReactNode } from "react"; import { Promisable } from "type-fest"; // exists to export default definePlugin({...}) @@ -202,6 +202,10 @@ export const enum ReporterTestable { FluxEvents = 1 << 4 } +export function defineDefault(value: T) { + return value; +} + export const enum OptionType { STRING, NUMBER, @@ -334,7 +338,8 @@ export interface IPluginOptionComponentProps { export interface PluginSettingComponentDef { type: OptionType.COMPONENT; - component: (props: IPluginOptionComponentProps) => JSX.Element; + component: (props: IPluginOptionComponentProps) => ReactNode | Promise; + default?: any; } /** Maps a `PluginSettingDef` to its value type */ diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts index 2681d51d..a11f056b 100644 --- a/src/webpack/common/components.ts +++ b/src/webpack/common/components.ts @@ -38,6 +38,7 @@ export const Forms = { export const Card = waitForComponent("Card", filters.componentByCode(".editable),", ".outline:")); export const Button = waitForComponent("Button", filters.componentByCode("#{intl::A11Y_LOADING_STARTED}))),!1")); export const Switch = waitForComponent("Switch", filters.componentByCode(".labelRow,ref:", ".disabledText")); +export const Checkbox = waitForComponent("Checkbox", filters.componentByCode(".checkboxWrapperDisabled:")); const Tooltips = mapMangledModuleLazy(".tooltipTop,bottom:", { Tooltip: filters.componentByCode("this.renderTooltip()]"), diff --git a/src/webpack/common/types/components.d.ts b/src/webpack/common/types/components.d.ts index 469cd428..9f1bb3aa 100644 --- a/src/webpack/common/types/components.d.ts +++ b/src/webpack/common/types/components.d.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import type { ComponentPropsWithRef, ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, JSX, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react"; +import type { ComponentPropsWithRef, ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, JSX, KeyboardEvent, MouseEvent, PointerEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react"; export type TextVariant = "heading-sm/normal" | "heading-sm/medium" | "heading-sm/semibold" | "heading-sm/bold" | "heading-md/normal" | "heading-md/medium" | "heading-md/semibold" | "heading-md/bold" | "heading-lg/normal" | "heading-lg/medium" | "heading-lg/semibold" | "heading-lg/bold" | "heading-xl/normal" | "heading-xl/medium" | "heading-xl/bold" | "heading-xxl/normal" | "heading-xxl/medium" | "heading-xxl/bold" | "eyebrow" | "heading-deprecated-14/normal" | "heading-deprecated-14/medium" | "heading-deprecated-14/bold" | "text-xxs/normal" | "text-xxs/medium" | "text-xxs/semibold" | "text-xxs/bold" | "text-xs/normal" | "text-xs/medium" | "text-xs/semibold" | "text-xs/bold" | "text-sm/normal" | "text-sm/medium" | "text-sm/semibold" | "text-sm/bold" | "text-md/normal" | "text-md/medium" | "text-md/semibold" | "text-md/bold" | "text-lg/normal" | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold" | "display-sm" | "display-md" | "display-lg" | "code"; @@ -197,6 +197,36 @@ export type Switch = ComponentType>; +export type CheckboxAligns = { + CENTER: "center"; + TOP: "top"; +}; + +export type CheckboxTypes = { + DEFAULT: "default"; + INVERTED: "inverted"; + GHOST: "ghost"; + ROW: "row"; +}; + +export type Checkbox = ComponentType> & { + Shapes: Record<"BOX" | "ROUND" | "SMALL_BOX", string>; + Aligns: CheckboxAligns; + Types: CheckboxTypes; +}; + export type Timestamp = ComponentType Date: Thu, 27 Feb 2025 21:34:29 -0300 Subject: [PATCH 8/8] Bump to 1.11.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f251aeda..32c3a329 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.11.5", + "version": "1.11.6", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": {