From e5afdf8a84b189c0fd52c832332dcdd7ed919a4a Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Mon, 25 May 2026 15:06:13 -0400 Subject: [PATCH] EquicordHelper: hideVoiceIndicatorForMutedChannels --- src/equicordplugins/equicordHelper/index.tsx | 49 +++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/equicordplugins/equicordHelper/index.tsx b/src/equicordplugins/equicordHelper/index.tsx index 5bfe14c2a..182e177b8 100644 --- a/src/equicordplugins/equicordHelper/index.tsx +++ b/src/equicordplugins/equicordHelper/index.tsx @@ -18,7 +18,7 @@ import { isAnyPluginDev } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; import { StandingState } from "@vencord/discord-types/enums"; import { findByCodeLazy, findStoreLazy } from "@webpack"; -import { Alerts, ApplicationCommandIndexStore, NavigationRouter, React, SettingsRouter, UserStore, useStateFromStores } from "@webpack/common"; +import { Alerts, ApplicationCommandIndexStore, NavigationRouter, React, SettingsRouter, UserGuildSettingsStore, UserStore, useStateFromStores, VoiceStateStore } from "@webpack/common"; import { ComponentType } from "react"; import { PluginButtons } from "./pluginButtons"; @@ -114,6 +114,12 @@ const settings = definePluginSettings({ restartNeeded: true, default: false }, + noModalAnimation: { + type: OptionType.BOOLEAN, + description: "Remove the 300ms long animation when opening or closing modals", + restartNeeded: true, + default: false + }, disableAdoptTagPrompt: { type: OptionType.BOOLEAN, description: "Disable the prompt to adopt tags", @@ -125,6 +131,12 @@ const settings = definePluginSettings({ description: "Forces JSON on gateway reconnect", restartNeeded: true, default: false, + }, + hideVoiceIndicatorForMutedChannels: { + type: OptionType.BOOLEAN, + description: "Hide voice indicator in server list when only active channels are muted", + restartNeeded: true, + default: false, } }); @@ -310,6 +322,32 @@ export default definePlugin({ ], predicate: () => Settings.winNativeTitleBar, }, + { + find: "DirectMessage: getSpringConfigs()", + replacement: [ + { + match: /("data-drop-hovering".{0,100}selected:(?:\i|!0),upperBadge:)(\i)(?=,lowerBadge:\i)/g, + replace: "$1$self.hasUnmutedVoiceChannel(arguments[0]?.guild?.id)?$2:null" + }, + { + match: /return (\i)\.type===\i\.\i\.GUILD_VOICE/, + replace: "$&&&!$self.isChannelMuted($1?.guildId,$1?.id)" + }, + { + match: /\.afkChannelId\?\[\].{0,50}.filter\((\i)=>\i\.type===\i\.\i\.VOICE/, + replace: "$&&&!$self.isChannelMuted($1?.guildId,$1?.channelId)" + }, + { + match: /\.getAllApplicationStreams\(\).filter\((\i)=>\i\.guildId===\i/, + replace: "$&&&!$self.isChannelMuted($1?.guildId,$1?.channelId)" + }, + { + match: /\.getEmbeddedActivitiesForGuild\((\i)\)(?=.flatMap\(\i=>)/, + replace: "$&.filter(e=>!$self.isChannelMuted($1?.guildId,e?.channelId))" + } + ], + predicate: () => settings.store.hideVoiceIndicatorForMutedChannels, + }, ], renderMessageAccessory(props) { return ( @@ -369,6 +407,15 @@ export default definePlugin({ if (settings.store.noBulletPoints) { removeMessagePreSendListener(listener); } + }, + isChannelMuted(guildId: string, channelId: string) { + return UserGuildSettingsStore.isChannelMuted(guildId, channelId); + }, + hasUnmutedVoiceChannel(guildId: string) { + const voiceStates = VoiceStateStore.getVoiceStates(guildId); + return Object.values(voiceStates ?? {}).some(voiceState => + !UserGuildSettingsStore.isChannelMuted(guildId, voiceState?.channelId!) + ); } });