Ensure voice mute/deafen status persists across disconnects and re-joins

This commit is contained in:
Jannis Braun
2026-02-19 18:02:00 +01:00
parent 5fae725675
commit 6deed231ab
4 changed files with 153 additions and 135 deletions
+4 -2
View File
@@ -115,16 +115,18 @@ class ConnectionManager {
}
leaveAllVoice(userId: string): string | null {
let leftChannelId: string | null = null;
for (const [channelId, users] of this.voiceStates) {
if (users.has(userId)) {
users.delete(userId);
if (users.size === 0) {
this.voiceStates.delete(channelId);
}
return channelId;
leftChannelId = channelId;
break;
}
}
return null;
return leftChannelId;
}
getVoiceUsers(channelId: string): Set<string> {