summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlTech98 <altech123159@gmail.com>2021-09-03 14:23:33 +0200
committerAlTech98 <altech123159@gmail.com>2021-09-03 14:23:33 +0200
commitc8345b3223bb3825c151bd811a5b6460b1bfbc38 (patch)
tree620e040d98a542ccccf33d9c0d3b063439ab0fac
parentMake the user leave the current channel before joining one in another guild (diff)
downloadserver-c8345b3223bb3825c151bd811a5b6460b1bfbc38.tar.xz
Fix to send the voice leave event only to the right session
-rw-r--r--gateway/src/opcodes/VoiceStateUpdate.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/gateway/src/opcodes/VoiceStateUpdate.ts b/gateway/src/opcodes/VoiceStateUpdate.ts

index 668508fd..fba0db1f 100644 --- a/gateway/src/opcodes/VoiceStateUpdate.ts +++ b/gateway/src/opcodes/VoiceStateUpdate.ts
@@ -23,7 +23,7 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { } //If a user change voice channel between guild we should send a left event first - if (voiceState.guild_id !== body.guild_id) { + if (voiceState.guild_id !== body.guild_id && voiceState.session_id === this.session_id) { await emitEvent({ event: "VOICE_STATE_UPDATE", data: { ...voiceState, channel_id: null },