From a91f5244a921f8e8161463cfa3bf259aada2e68e Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 8 Sep 2023 16:24:37 -0700 Subject: [PATCH] Mute on join if ZED_IMPERSONATE is set --- crates/call/src/room.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index cc7445dbcc..e7899ab2d8 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -172,7 +172,7 @@ impl Room { cx.spawn(|this, mut cx| async move { connect.await?; - if !cx.read(|cx| settings::get::(cx).mute_on_join) { + if !cx.read(Self::mute_on_join) { this.update(&mut cx, |this, cx| this.share_microphone(cx)) .await?; } @@ -301,6 +301,10 @@ impl Room { }) } + pub fn mute_on_join(cx: &AppContext) -> bool { + settings::get::(cx).mute_on_join || client::IMPERSONATE_LOGIN.is_some() + } + fn from_join_response( response: proto::JoinRoomResponse, client: Arc, @@ -1124,7 +1128,7 @@ impl Room { self.live_kit .as_ref() .and_then(|live_kit| match &live_kit.microphone_track { - LocalTrack::None => Some(settings::get::(cx).mute_on_join), + LocalTrack::None => Some(Self::mute_on_join(cx)), LocalTrack::Pending { muted, .. } => Some(*muted), LocalTrack::Published { muted, .. } => Some(*muted), })