From 3104275d87af9b4abd9cd8a927d3c389e8583249 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 27 Jun 2023 17:19:18 +0200 Subject: [PATCH] Keep users muted once they undeafen themselves --- crates/call/src/room.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index 48a35b29f6..3c94feae4c 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -1213,7 +1213,11 @@ impl Room { let mut tasks = Vec::with_capacity(self.remote_participants.len()); // Context notification is sent within set_mute itself. - let _ = Self::set_mute(live_kit, live_kit.deafened, cx)?; // todo (osiewicz): we probably want to schedule it on fg/bg? + if live_kit.deafened { + // Unmute microphone only if we're going from unmuted -> muted state. + // We don't want to unmute user automatically. + let _ = Self::set_mute(live_kit, live_kit.deafened, cx)?; // todo (osiewicz): we probably want to schedule it on fg/bg? + } for participant in self.remote_participants.values() { for track in live_kit .room