From d86423cae3a52b4daef70038d8a507c1c4dd9e37 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 28 Jan 2026 04:53:09 +0100 Subject: [PATCH] VcNarrator: only narrate events of current session --- packages/discord-types/src/stores/AuthenticationStore.d.ts | 2 +- src/plugins/vcNarrator/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/discord-types/src/stores/AuthenticationStore.d.ts b/packages/discord-types/src/stores/AuthenticationStore.d.ts index 3ad2354f6..1c95db532 100644 --- a/packages/discord-types/src/stores/AuthenticationStore.d.ts +++ b/packages/discord-types/src/stores/AuthenticationStore.d.ts @@ -5,7 +5,7 @@ export class AuthenticationStore extends FluxStore { * Gets the id of the current user */ getId(): string; - + getSessionId(): string; // This Store has a lot more methods related to everything Auth, but they really should // not be needed, so they are not typed } diff --git a/src/plugins/vcNarrator/index.tsx b/src/plugins/vcNarrator/index.tsx index 5ecdc03b8..16bbd30ac 100644 --- a/src/plugins/vcNarrator/index.tsx +++ b/src/plugins/vcNarrator/index.tsx @@ -22,7 +22,7 @@ import { Logger } from "@utils/Logger"; import { Margins } from "@utils/margins"; import { wordsToTitle } from "@utils/text"; import definePlugin, { ReporterTestable } from "@utils/types"; -import { Button, ChannelStore, Forms, GuildMemberStore, SelectedChannelStore, SelectedGuildStore, useMemo, UserStore, VoiceStateStore } from "@webpack/common"; +import { AuthenticationStore, Button, ChannelStore, Forms, GuildMemberStore, SelectedChannelStore, SelectedGuildStore, useMemo, UserStore, VoiceStateStore } from "@webpack/common"; import { ReactElement } from "react"; import { getCurrentVoice, settings } from "./settings"; @@ -35,6 +35,7 @@ interface VoiceStateChangeEvent { mute: boolean; selfDeaf: boolean; selfMute: boolean; + sessionId: string; } // Mute/Deaf for other people than you is commented out, because otherwise someone can spam it and it will be annoying @@ -170,6 +171,7 @@ export default definePlugin({ for (const state of voiceStates) { const { userId, channelId, oldChannelId } = state; const isMe = userId === myId; + if (isMe && state.sessionId !== AuthenticationStore.getSessionId()) continue; if (!isMe) { if (!myChanId) continue; if (channelId !== myChanId && oldChannelId !== myChanId) continue;