From 63b0bebb6d68415b5e562df7a39f570ee98f12e0 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 3 Sep 2025 18:09:12 -0400 Subject: [PATCH 01/17] Drop AutoJump Temp --- src/equicordplugins/autoJump/README.md | 3 - src/equicordplugins/autoJump/index.tsx | 69 ------------------- src/equicordplugins/chatButtonsPlus/index.tsx | 3 +- src/equicordplugins/inviteDefaults/index.ts | 2 +- src/equicordplugins/rpcEditor/index.tsx | 2 +- src/plugins/vcNarrator/VoiceSetting.tsx | 1 - 6 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 src/equicordplugins/autoJump/README.md delete mode 100644 src/equicordplugins/autoJump/index.tsx diff --git a/src/equicordplugins/autoJump/README.md b/src/equicordplugins/autoJump/README.md deleted file mode 100644 index e361254ca..000000000 --- a/src/equicordplugins/autoJump/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# AutoJump - -Jumps to the first message in new messages for a channel diff --git a/src/equicordplugins/autoJump/index.tsx b/src/equicordplugins/autoJump/index.tsx deleted file mode 100644 index b05ba1e64..000000000 --- a/src/equicordplugins/autoJump/index.tsx +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { NavContextMenuPatchCallback } from "@api/ContextMenu"; -import { definePluginSettings } from "@api/Settings"; -import { EquicordDevs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; -import { ChannelStore, Menu, MessageActions, NavigationRouter } from "@webpack/common"; - -interface ChannelSelectEvent { - type: "CHANNEL_SELECT"; - channelId: string | null; - guildId: string | null; -} - -let lastChannelId = "0"; - -function autoJump({ guild_id, id: channelId }) { - const guildId = guild_id ?? "@me"; - - lastChannelId = channelId; - NavigationRouter.transitionTo(`/channels/${guildId}/${channelId}`); - MessageActions.jumpToPresent(channelId, { limit: null }); -} - -const MenuPatch: NavContextMenuPatchCallback = (children, { channel }) => { - children.push( - { - autoJump(channel); - }} - /> - ); -}; - -const settings = definePluginSettings({ - autoJumping: { - type: OptionType.BOOLEAN, - description: "Automatically jump to the last message in the channel when switching channels", - default: false - } -}); - -export default definePlugin({ - name: "AutoJump", - description: "Jumps to Last Message in Channel", - authors: [EquicordDevs.omaw], - settings, - contextMenus: { - "channel-context": MenuPatch, - "user-context": MenuPatch, - "thread-context": MenuPatch - }, - flux: { - async CHANNEL_SELECT({ guildId, channelId }: ChannelSelectEvent) { - if (!settings.store.autoJumping || !channelId) return; - - const channel = ChannelStore.getChannel(channelId); - if (!channel || channel.id === lastChannelId) return; - - autoJump({ guild_id: guildId, id: channelId }); - } - } -}); diff --git a/src/equicordplugins/chatButtonsPlus/index.tsx b/src/equicordplugins/chatButtonsPlus/index.tsx index 3634d67d1..5a8836acf 100644 --- a/src/equicordplugins/chatButtonsPlus/index.tsx +++ b/src/equicordplugins/chatButtonsPlus/index.tsx @@ -8,7 +8,7 @@ import "./styles.css"; import { ChatBarButton } from "@api/ChatButtons"; import { DataStore } from "@api/index"; -import { definePluginSettings, Settings } from "@api/Settings"; +import { definePluginSettings, migratePluginSettings, Settings } from "@api/Settings"; import { EquicordDevs } from "@utils/constants"; import { getCurrentChannel, sendMessage } from "@utils/discord"; import { useForceUpdater } from "@utils/react"; @@ -223,6 +223,7 @@ const settings = definePluginSettings({ } }); +migratePluginSettings("ChatButtonsPlus", "Meow", "Woof"); export default definePlugin({ name: "ChatButtonsPlus", description: "Add custom chat buttons with personalized + messages and SVG icons", diff --git a/src/equicordplugins/inviteDefaults/index.ts b/src/equicordplugins/inviteDefaults/index.ts index 1cb5baf1d..288622324 100644 --- a/src/equicordplugins/inviteDefaults/index.ts +++ b/src/equicordplugins/inviteDefaults/index.ts @@ -52,7 +52,7 @@ export default definePlugin({ find: ".GUILD_CREATE_INVITE_SUGGESTION,defaultMaxAge", replacement: [ { - match: /(?<=maxAge:)null!=\(\i=null!=\i\?\i:\i\)\?\i:\i.value/, + match: /(?<=maxAge:)null!=\(\i=null!=\i\?\i:\i\)\?\i:\i.\i/, replace: "$self.settings.store.inviteDuration" }, { diff --git a/src/equicordplugins/rpcEditor/index.tsx b/src/equicordplugins/rpcEditor/index.tsx index 59c56ec78..b623caacf 100644 --- a/src/equicordplugins/rpcEditor/index.tsx +++ b/src/equicordplugins/rpcEditor/index.tsx @@ -109,7 +109,7 @@ export default definePlugin({ { find: '"LocalActivityStore"', replacement: { - match: /\i\(\i\)\{.{0,25}activity:(\i)\}=\i;/, + match: /\i\(\i\)\{.{0,25}activity:(\i).*?\}=\i;/, replace: "$&$self.patchActivity($1);", } } diff --git a/src/plugins/vcNarrator/VoiceSetting.tsx b/src/plugins/vcNarrator/VoiceSetting.tsx index fb5c739c2..a16b16924 100644 --- a/src/plugins/vcNarrator/VoiceSetting.tsx +++ b/src/plugins/vcNarrator/VoiceSetting.tsx @@ -101,7 +101,6 @@ function ComplexPicker({ voice, voices }: PickerProps) { ); } - function VoiceSetting() { const voices = useMemo(() => window.speechSynthesis?.getVoices() ?? [], []); const { voice } = settings.use(["voice"]); From b7f19bbe3735590dcd4e52e1a491d2cbf18fe88b Mon Sep 17 00:00:00 2001 From: union <43791401+Unionizing@users.noreply.github.com> Date: Wed, 3 Sep 2025 20:41:06 -0400 Subject: [PATCH 02/17] NoReplyMention: add role whitelist / blacklist (#2794) Co-authored-by: V --- src/plugins/noReplyMention/index.tsx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/plugins/noReplyMention/index.tsx b/src/plugins/noReplyMention/index.tsx index 4af78ee29..28bfc2566 100644 --- a/src/plugins/noReplyMention/index.tsx +++ b/src/plugins/noReplyMention/index.tsx @@ -20,6 +20,7 @@ import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import type { Message } from "@vencord/discord-types"; +import { ChannelStore, GuildMemberStore } from "@webpack/common"; const settings = definePluginSettings({ userList: { @@ -28,16 +29,22 @@ const settings = definePluginSettings({ type: OptionType.STRING, default: "1234567890123445,1234567890123445", }, + roleList: { + description: + "List of roles to allow or exempt pings for (separated by commas or spaces)", + type: OptionType.STRING, + default: "1234567890123445,1234567890123445", + }, shouldPingListed: { description: "Behaviour", type: OptionType.SELECT, options: [ { - label: "Do not ping the listed users", + label: "Do not ping the listed users / roles", value: false, }, { - label: "Only ping the listed users", + label: "Only ping the listed users / roles", value: true, default: true, }, @@ -57,7 +64,14 @@ export default definePlugin({ settings, shouldMention(message: Message, isHoldingShift: boolean) { - const isListed = settings.store.userList.includes(message.author.id); + let isListed = settings.store.userList.includes(message.author.id); + + const channel = ChannelStore.getChannel(message.channel_id); + if (channel?.guild_id && !isListed) { + const roles = GuildMemberStore.getMember(channel.guild_id, message.author.id)?.roles; + isListed = !!roles && roles.some(role => settings.store.roleList.includes(role)); + } + const isExempt = settings.store.shouldPingListed ? isListed : !isListed; return settings.store.inverseShiftReply ? isHoldingShift !== isExempt : !isHoldingShift && isExempt; }, From 77b016de366c827786bdcd45819552696c562875 Mon Sep 17 00:00:00 2001 From: union <43791401+Unionizing@users.noreply.github.com> Date: Wed, 3 Sep 2025 20:46:02 -0400 Subject: [PATCH 03/17] ReverseImageSearch: add Bing (#2793) --- src/plugins/reverseImageSearch/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/reverseImageSearch/index.tsx b/src/plugins/reverseImageSearch/index.tsx index a2e7b7e66..3c1a5402d 100644 --- a/src/plugins/reverseImageSearch/index.tsx +++ b/src/plugins/reverseImageSearch/index.tsx @@ -28,6 +28,7 @@ const Engines = { Yandex: "https://yandex.com/images/search?rpt=imageview&url=", SauceNAO: "https://saucenao.com/search.php?url=", IQDB: "https://iqdb.org/?url=", + Bing: "https://www.bing.com/images/search?view=detailv2&iss=sbi&q=imgurl:", TinEye: "https://www.tineye.com/search?url=", ImgOps: "https://imgops.com/start?url=" } as const; From c007d23db9e94562d7929454d9aeb0e094be4acc Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 4 Sep 2025 10:15:02 -0400 Subject: [PATCH 04/17] MediaPlaybackSpeed: Update --- .../components/SpeedIcon.tsx | 2 +- .../mediaPlaybackSpeed/index.tsx | 40 +++++++------------ .../mediaPlaybackSpeed/styles.css | 2 +- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/equicordplugins/mediaPlaybackSpeed/components/SpeedIcon.tsx b/src/equicordplugins/mediaPlaybackSpeed/components/SpeedIcon.tsx index c6d4a907d..b23a358bb 100644 --- a/src/equicordplugins/mediaPlaybackSpeed/components/SpeedIcon.tsx +++ b/src/equicordplugins/mediaPlaybackSpeed/components/SpeedIcon.tsx @@ -13,7 +13,7 @@ function SpeedIcon() { fill="currentColor" viewBox="0 -960 960 960" > - + ); } diff --git a/src/equicordplugins/mediaPlaybackSpeed/index.tsx b/src/equicordplugins/mediaPlaybackSpeed/index.tsx index b2de586c1..b952a0e22 100644 --- a/src/equicordplugins/mediaPlaybackSpeed/index.tsx +++ b/src/equicordplugins/mediaPlaybackSpeed/index.tsx @@ -11,7 +11,7 @@ import { classNameFactory } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin, { makeRange, OptionType } from "@utils/types"; -import { ContextMenuApi, FluxDispatcher, Heading, Menu, React, Tooltip, useEffect } from "@webpack/common"; +import { ContextMenuApi, FluxDispatcher, Menu, React, Tooltip, useEffect } from "@webpack/common"; import { RefObject } from "react"; import SpeedIcon from "./components/SpeedIcon"; @@ -23,15 +23,6 @@ const max = 3.5; const speeds = makeRange(min, max, 0.25); const settings = definePluginSettings({ - test: { - type: OptionType.COMPONENT, - description: "", - component() { - return - Default playback speeds - ; - } - }, defaultVoiceMessageSpeed: { type: OptionType.SLIDER, default: 1, @@ -61,7 +52,7 @@ export default definePlugin({ settings, - PlaybackSpeedComponent({ mediaRef }: { mediaRef: MediaRef; }) { + renderPlaybackSpeedComponent: ErrorBoundary.wrap(({ mediaRef }: { mediaRef: MediaRef; }) => { const changeSpeed = (speed: number) => { const media = mediaRef?.current; if (media) { @@ -70,11 +61,16 @@ export default definePlugin({ }; useEffect(() => { - if (!mediaRef?.current) return; - const media = mediaRef.current; + const media = mediaRef?.current; + if (!media) return; if (media.tagName === "AUDIO") { const isVoiceMessage = media.className.includes("audioElement_"); - changeSpeed(isVoiceMessage ? settings.store.defaultVoiceMessageSpeed : settings.store.defaultAudioSpeed); + if (isVoiceMessage) { + // Workaround because Discord seems to override it somewhere + media.addEventListener("play", () => { changeSpeed(settings.store.defaultVoiceMessageSpeed); }, { once: true }); + } else { + changeSpeed(settings.store.defaultAudioSpeed); + } } else if (media.tagName === "VIDEO") { changeSpeed(settings.store.defaultVideoSpeed); } @@ -113,21 +109,15 @@ export default definePlugin({ )} ); - }, - - renderComponent(mediaRef: MediaRef) { - return - - ; - }, + }), patches: [ - // voice message embeds + // replace voice message embed speed control because ours provides more speeds { find: "\"--:--\"", replacement: { - match: /onVolumeShow:\i,onVolumeHide:\i\}\)(?<=useCallback\(\(\)=>\{let \i=(\i).current;.+?)/, - replace: "$&,$self.renderComponent($1)" + match: /(ref:(\i),className.*?)\(0,.{0,50}playbackRateContainer.*?\}\)\}\)/, + replace: "$1$self.renderPlaybackSpeedComponent({mediaRef:$2})" } }, // audio & video embeds @@ -143,7 +133,7 @@ export default definePlugin({ find: "AUDIO:\"AUDIO\"", replacement: { match: /onVolumeHide:\i,iconClassName:\i.controlIcon,iconColor:"currentColor",sliderWrapperClassName:\i.volumeSliderWrapper\}\)\}\),/, - replace: "$&$self.renderComponent(this.props.mediaRef)," + replace: "$&$self.renderPlaybackSpeedComponent({mediaRef:this?.props?.mediaRef})," } } ] diff --git a/src/equicordplugins/mediaPlaybackSpeed/styles.css b/src/equicordplugins/mediaPlaybackSpeed/styles.css index 816190a48..e14279a86 100644 --- a/src/equicordplugins/mediaPlaybackSpeed/styles.css +++ b/src/equicordplugins/mediaPlaybackSpeed/styles.css @@ -7,4 +7,4 @@ .vc-media-playback-speed-icon:hover { color: var(--interactive-active); -} +} \ No newline at end of file From 093e7a58d2b9fa63ca6afc9f221b9d91481b3871 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 4 Sep 2025 10:48:37 -0400 Subject: [PATCH 05/17] MediaPlayBackSpeed: Make Patches Better --- src/equicordplugins/mediaPlaybackSpeed/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/equicordplugins/mediaPlaybackSpeed/index.tsx b/src/equicordplugins/mediaPlaybackSpeed/index.tsx index b952a0e22..39aa162aa 100644 --- a/src/equicordplugins/mediaPlaybackSpeed/index.tsx +++ b/src/equicordplugins/mediaPlaybackSpeed/index.tsx @@ -116,8 +116,8 @@ export default definePlugin({ { find: "\"--:--\"", replacement: { - match: /(ref:(\i),className.*?)\(0,.{0,50}playbackRateContainer.*?\}\)\}\)/, - replace: "$1$self.renderPlaybackSpeedComponent({mediaRef:$2})" + match: /\(0,\i\.jsxs?\)\(.{0,50}\.playbackRateContainer.+?}\)}\)(?<=playbackCacheKey:\i\}=\i,(\i).+?)/, + replace: "$self.renderPlaybackSpeedComponent({mediaRef:$1})" } }, // audio & video embeds @@ -132,7 +132,7 @@ export default definePlugin({ { find: "AUDIO:\"AUDIO\"", replacement: { - match: /onVolumeHide:\i,iconClassName:\i.controlIcon,iconColor:"currentColor",sliderWrapperClassName:\i.volumeSliderWrapper\}\)\}\),/, + match: /\i.volumeSliderWrapper\}\)\}\),/, replace: "$&$self.renderPlaybackSpeedComponent({mediaRef:this?.props?.mediaRef})," } } From 7cf5ac4b69d58d191ac613ce4d098535808cc49d Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:27:32 -0400 Subject: [PATCH 06/17] Fix Patches --- src/equicordplugins/equicordToolbox/index.tsx | 4 ++-- src/plugins/experiments/index.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/equicordplugins/equicordToolbox/index.tsx b/src/equicordplugins/equicordToolbox/index.tsx index ea175d513..1f3937dad 100644 --- a/src/equicordplugins/equicordToolbox/index.tsx +++ b/src/equicordplugins/equicordToolbox/index.tsx @@ -152,9 +152,9 @@ export default definePlugin({ patches: [ { - find: '"M9 3v18"', + find: '"TITLEBAR_FAST_TRAVEL"', replacement: { - match: /focusSectionProps:"HELP".{0,20},className:(\i\.button)\}\),/, + match: /focusSectionProps:"HELP".{0,20},className:(\i)\}\),/, replace: "$& $self.renderVencordPopoutButton($1)," } } diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index 203ef2582..b3cd27bdb 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -68,7 +68,7 @@ export default definePlugin({ }, // Change top right chat toolbar button from the help one to the dev one { - find: '"M9 3v18"', + find: '"TITLEBAR_FAST_TRAVEL"', replacement: { match: /hasBugReporterAccess:(\i)/, replace: "_hasBugReporterAccess:$1=true" From 1d00ba4161fd1c285d1efe25f489c8bf68c77359 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:59:30 -0400 Subject: [PATCH 07/17] fix patches for Experiments and Vencord Toolbox (#3647) --- src/plugins/experiments/index.tsx | 2 +- src/plugins/vencordToolbox/index.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index e916e158d..9b6a33779 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -80,7 +80,7 @@ export default definePlugin({ }, // Change top right chat toolbar button from the help one to the dev one { - find: '"M9 3v18"', + find: '?"BACK_FORWARD_NAVIGATION":', replacement: { match: /hasBugReporterAccess:(\i)/, replace: "_hasBugReporterAccess:$1=true" diff --git a/src/plugins/vencordToolbox/index.tsx b/src/plugins/vencordToolbox/index.tsx index 1bc97cf56..5a7b8cad1 100644 --- a/src/plugins/vencordToolbox/index.tsx +++ b/src/plugins/vencordToolbox/index.tsx @@ -129,9 +129,10 @@ export default definePlugin({ patches: [ { - find: '"M9 3v18"', + find: '?"BACK_FORWARD_NAVIGATION":', replacement: { - match: /focusSectionProps:"HELP".{0,20},className:(\i\.button)\}\),/, + // TODO: (?:\.button) is for stable compat and should be removed soon:tm: + match: /focusSectionProps:"HELP".{0,20},className:(\i(?:\.button)?)\}\),/, replace: "$& $self.renderVencordPopoutButton($1)," } } From 8eb69afd4b75b8ff667e7f57a9da11b34d772e94 Mon Sep 17 00:00:00 2001 From: creations Date: Thu, 4 Sep 2025 17:56:12 -0400 Subject: [PATCH 08/17] fix issues with diff view messing up emojis and mentions (#372) --- src/plugins/messageLogger/diffUtils.ts | 39 +++++++++++++++++++-- src/plugins/messageLogger/index.tsx | 22 ++++++++---- src/plugins/messageLogger/messageLogger.css | 37 +++++++++++++++++++ 3 files changed, 90 insertions(+), 8 deletions(-) diff --git a/src/plugins/messageLogger/diffUtils.ts b/src/plugins/messageLogger/diffUtils.ts index 3713058a3..2cda40f4e 100644 --- a/src/plugins/messageLogger/diffUtils.ts +++ b/src/plugins/messageLogger/diffUtils.ts @@ -9,6 +9,41 @@ export interface DiffPart { text: string; } +function tokenizeMessage(text: string): string[] { + const tokens: string[] = []; + let i = 0; + + while (i < text.length) { + // handle Discord custom emojis: <:name:id> or + if (text[i] === "<" && (text.slice(i + 1, i + 3) === ":" || text.slice(i + 1, i + 3) === "a:")) { + const endIndex = text.indexOf(">", i); + if (endIndex !== -1) { + tokens.push(text.slice(i, endIndex + 1)); + i = endIndex + 1; + continue; + } + } + + // handle mentions: <@id>, <@!id>, <@&id>, <#id> + if (text[i] === "<" && text[i + 1] === "@" || + (text[i] === "<" && text[i + 1] === "#")) { + const endIndex = text.indexOf(">", i); + if (endIndex !== -1) { + tokens.push(text.slice(i, endIndex + 1)); + i = endIndex + 1; + continue; + } + } + + // handle regular characters (including Unicode emojis) + const char = Array.from(text.slice(i))[0]; + tokens.push(char); + i += char.length; + } + + return tokens; +} + export function createWordDiff(oldText: string, newText: string): DiffPart[] { // suffix shit, if oldText is shorter than newText and newText starts with oldText if (oldText.length < newText.length && newText.startsWith(oldText)) { @@ -55,8 +90,8 @@ export function createWordDiff(oldText: string, newText: string): DiffPart[] { } // For complex cases, fall back to LCS algorithm - const oldChars = oldText.split(""); - const newChars = newText.split(""); + const oldChars = tokenizeMessage(oldText); + const newChars = tokenizeMessage(newText); const result: DiffPart[] = []; const dp: number[][] = []; diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index 6abc73432..7805175b8 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -166,22 +166,32 @@ const patchChannelContextMenu: NavContextMenuPatchCallback = ( ); }; -function renderDiffParts(diffParts: DiffPart[]) { +function renderDiffParts(diffParts: DiffPart[], message: Message) { return diffParts.map((part, index) => { + const parsedContent = Parser.parse(part.text, true, { + channelId: message.channel_id, + messageId: message.id, + allowLinks: true, + allowHeading: true, + allowList: true, + allowEmojiLinks: true, + viewingChannelId: SelectedChannelStore.getChannelId(), + }); + if (part.type === "unchanged") { - return React.createElement("span", { key: index }, part.text); + return React.createElement("span", { key: index }, parsedContent); } else if (part.type === "added") { return React.createElement("span", { key: index, className: "messagelogger-diff-added" - }, part.text); + }, parsedContent); } else if (part.type === "removed") { return React.createElement("span", { key: index, className: "messagelogger-diff-removed" - }, part.text); + }, parsedContent); } - return React.createElement("span", { key: index }, part.text); + return React.createElement("span", { key: index }, parsedContent); }); } @@ -189,7 +199,7 @@ export function parseEditContent(content: string, message: Message, previousCont const perMessageDiffEnabled = !disabledDiffMessages.has(message.id); if (previousContent && content !== previousContent && settings.store.showEditDiffs && perMessageDiffEnabled) { const diffParts = createMessageDiff(content, previousContent); - return renderDiffParts(diffParts); + return renderDiffParts(diffParts, message); } return Parser.parse(content, true, { diff --git a/src/plugins/messageLogger/messageLogger.css b/src/plugins/messageLogger/messageLogger.css index 5f4e5bb13..501544069 100644 --- a/src/plugins/messageLogger/messageLogger.css +++ b/src/plugins/messageLogger/messageLogger.css @@ -54,8 +54,45 @@ color: #F47068; } +.messagelogger-diff-added [class*="emojiContainer"], +.messagelogger-diff-added img.emoji { + position: relative; +} + +.messagelogger-diff-added [class*="emojiContainer"]::after, +.messagelogger-diff-added img.emoji::after { + content: ''; + position: absolute; + inset: 0; + background-color: rgb(133 232 157 / 60%); + border-radius: 3px; + pointer-events: none; +} + +.messagelogger-diff-removed [class*="emojiContainer"], +.messagelogger-diff-removed img.emoji { + position: relative; +} + +.messagelogger-diff-removed [class*="emojiContainer"]::after, +.messagelogger-diff-removed img.emoji::after { + content: ''; + position: absolute; + inset: 0; + background-color: rgb(244 112 104 / 60%); + border-radius: 3px; + pointer-events: none; +} + /* when diffs are disabled for a specific message, remove diff colors */ .messagelogger-diff-disabled .messagelogger-diff-added, .messagelogger-diff-disabled .messagelogger-diff-removed { color: inherit; } + +.messagelogger-diff-disabled .messagelogger-diff-added [class*="emojiContainer"]::after, +.messagelogger-diff-disabled .messagelogger-diff-added img.emoji::after, +.messagelogger-diff-disabled .messagelogger-diff-removed [class*="emojiContainer"]::after, +.messagelogger-diff-disabled .messagelogger-diff-removed img.emoji::after { + display: none !important; +} \ No newline at end of file From aa98546bea3985151d4437d7a2d89e160ce66e31 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 4 Sep 2025 20:00:04 -0400 Subject: [PATCH 09/17] Patch Fixes --- src/equicordplugins/channelTabs/index.tsx | 4 ++-- src/plugins/fakeNitro/index.tsx | 3 +-- src/plugins/onePingPerDM/index.ts | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/equicordplugins/channelTabs/index.tsx b/src/equicordplugins/channelTabs/index.tsx index 2a693b24a..9a33e1bc2 100644 --- a/src/equicordplugins/channelTabs/index.tsx +++ b/src/equicordplugins/channelTabs/index.tsx @@ -80,8 +80,8 @@ export default definePlugin({ { find: "(this,\"handleMessageClick\"", replacement: { - match: /(?<=(\i)\.isSearchHit\));(?=null!=(\i))/, - replace: ";if ($1.ctrlKey) return $self.open($2);" + match: /(?<=(\i)\.preventDefault.*?)(?=null!=(\i))/, + replace: "if ($1.ctrlKey) return $self.open($2);" } }, // prevent issues with the pins/inbox popouts being too tall diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index cbef80d05..a3cff1fe0 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -167,7 +167,6 @@ function makeBypassPatches(): Omit { { func: "canUseHighVideoUploadQuality", predicate: () => settings.store.enableStreamQualityBypass }, { func: "canStreamQuality", predicate: () => settings.store.enableStreamQualityBypass }, { func: "canUseClientThemes" }, - { func: "canUseCustomNotificationSounds" }, { func: "canUsePremiumAppIcons" } ]; @@ -184,7 +183,7 @@ function makeBypassPatches(): Omit { export default definePlugin({ name: "FakeNitro", authors: [Devs.Arjix, Devs.D3SOX, Devs.Ven, Devs.fawn, Devs.captain, Devs.Nuckyz, Devs.AutumnVN], - description: "Allows you to stream in nitro quality, send fake emojis/stickers, use client themes and custom Discord notifications.", + description: "Allows you to stream in nitro quality, send fake emojis/stickers, and use client themes", dependencies: ["MessageEventsAPI"], settings, diff --git a/src/plugins/onePingPerDM/index.ts b/src/plugins/onePingPerDM/index.ts index 8a72533d9..f7bf669a8 100644 --- a/src/plugins/onePingPerDM/index.ts +++ b/src/plugins/onePingPerDM/index.ts @@ -46,14 +46,16 @@ export default definePlugin({ settings, patches: [{ find: ".getDesktopType()===", - replacement: [{ - match: /(\i\.\i\.getDesktopType\(\)===\i\.\i\.NEVER)\)/, - replace: "$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else " - }, - { - match: /sound:(\i\?\i:void 0,soundpack:\i,volume:\i,onClick)/, - replace: "sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1" - }] + replacement: [ + { + match: /(\i\.\i\.getDesktopType\(\)===\i\.\i\.NEVER)\)/, + replace: "$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else " + }, + { + match: /sound:(\i\?\i:void 0,volume:\i,onClick)/, + replace: "sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1" + } + ] }], isPrivateChannelRead(message: MessageJSON) { const ignoreList = settings.store.ignoreUsers.split(", ").filter(Boolean); From 0aaf5daff25ecef4d8101329ddb5fba3bc32b2aa Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 4 Sep 2025 20:04:46 -0400 Subject: [PATCH 10/17] period --- src/plugins/fakeNitro/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index a3cff1fe0..9d6138994 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -183,7 +183,7 @@ function makeBypassPatches(): Omit { export default definePlugin({ name: "FakeNitro", authors: [Devs.Arjix, Devs.D3SOX, Devs.Ven, Devs.fawn, Devs.captain, Devs.Nuckyz, Devs.AutumnVN], - description: "Allows you to stream in nitro quality, send fake emojis/stickers, and use client themes", + description: "Allows you to stream in nitro quality, send fake emojis/stickers, and use client themes.", dependencies: ["MessageEventsAPI"], settings, From 2aa47af0c958821b6081637b73559e09c65a74dd Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Fri, 5 Sep 2025 08:13:29 -0400 Subject: [PATCH 11/17] SpotifyActivityToggle: Don't Use Settings --- .../spotifyActivityToggle/index.tsx | 72 +++++++++---------- src/plugins/onePingPerDM/index.ts | 28 ++++---- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/equicordplugins/spotifyActivityToggle/index.tsx b/src/equicordplugins/spotifyActivityToggle/index.tsx index a9f3b2831..ebee29f76 100644 --- a/src/equicordplugins/spotifyActivityToggle/index.tsx +++ b/src/equicordplugins/spotifyActivityToggle/index.tsx @@ -4,12 +4,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { definePluginSettings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { EquicordDevs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; +import definePlugin from "@utils/types"; import { findComponentByCodeLazy } from "@webpack"; -import { Constants, React, RestAPI } from "@webpack/common"; +import { Constants, React, RestAPI, useEffect, useState } from "@webpack/common"; const Button = findComponentByCodeLazy(".NONE,disabled:", ".PANEL_BUTTON"); @@ -35,55 +34,54 @@ function makeSpotifyIcon(enabled: boolean) { ); } -async function setSpotifyActivity(value: boolean) { - const { body } = await RestAPI.get({ - url: Constants.Endpoints.CONNECTIONS - }); - - if (!body) return; - const spotifyId = body.find(conn => conn.type === "spotify")?.id; - - await RestAPI.patch({ - url: Constants.Endpoints.CONNECTION("spotify", spotifyId), - body: { - show_activity: value, - }, - }); -} - function SpotifyActivityToggleButton() { - const { spotifyConnection } = settings.store; + const [loading, setLoading] = useState(true); + const [id, setId] = useState(null); + const [showActivity, setShowActivity] = useState(null); + + useEffect(() => { + (async () => { + const { body } = await RestAPI.get({ + url: Constants.Endpoints.CONNECTIONS, + }); + if (!body) return; + + const spotifyConn = body.find(c => c.type === "spotify"); + if (spotifyConn) { + setId(spotifyConn.id); + setShowActivity(spotifyConn.show_activity); + } + setLoading(false); + })(); + }, []); + + if (loading || !id || showActivity === null) return null; return (