From a8d56263ea0f1538767725ee2b67038f72eb22ef Mon Sep 17 00:00:00 2001
From: Piotr 'pwh' Hanusiak
Date: Wed, 20 Apr 2022 14:32:23 +0200
Subject: [PATCH] leave group immediately if status changed to silent | jitsi
---
back/src/Model/GameRoom.ts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/back/src/Model/GameRoom.ts b/back/src/Model/GameRoom.ts
index ba1a7f0c..2f94a8f0 100644
--- a/back/src/Model/GameRoom.ts
+++ b/back/src/Model/GameRoom.ts
@@ -206,7 +206,11 @@ export class GameRoom {
}
updatePlayerDetails(user: User, playerDetailsMessage: SetPlayerDetailsMessage) {
+ const isSilent = user.silent;
user.updateDetails(playerDetailsMessage);
+ if (!isSilent && user.group !== undefined && user.silent) {
+ this.leaveGroup(user);
+ }
}
private updateUserGroup(user: User): void {