mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 19:45:09 +00:00
VcNarrator: only narrate events of current session
This commit is contained in:
parent
781a2f7c60
commit
d86423cae3
2 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue