mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
Mute on join if ZED_IMPERSONATE is set
This commit is contained in:
parent
ed7bc91dbd
commit
a91f5244a9
1 changed files with 6 additions and 2 deletions
|
@ -172,7 +172,7 @@ impl Room {
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
connect.await?;
|
connect.await?;
|
||||||
|
|
||||||
if !cx.read(|cx| settings::get::<CallSettings>(cx).mute_on_join) {
|
if !cx.read(Self::mute_on_join) {
|
||||||
this.update(&mut cx, |this, cx| this.share_microphone(cx))
|
this.update(&mut cx, |this, cx| this.share_microphone(cx))
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
@ -301,6 +301,10 @@ impl Room {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn mute_on_join(cx: &AppContext) -> bool {
|
||||||
|
settings::get::<CallSettings>(cx).mute_on_join || client::IMPERSONATE_LOGIN.is_some()
|
||||||
|
}
|
||||||
|
|
||||||
fn from_join_response(
|
fn from_join_response(
|
||||||
response: proto::JoinRoomResponse,
|
response: proto::JoinRoomResponse,
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
|
@ -1124,7 +1128,7 @@ impl Room {
|
||||||
self.live_kit
|
self.live_kit
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|live_kit| match &live_kit.microphone_track {
|
.and_then(|live_kit| match &live_kit.microphone_track {
|
||||||
LocalTrack::None => Some(settings::get::<CallSettings>(cx).mute_on_join),
|
LocalTrack::None => Some(Self::mute_on_join(cx)),
|
||||||
LocalTrack::Pending { muted, .. } => Some(*muted),
|
LocalTrack::Pending { muted, .. } => Some(*muted),
|
||||||
LocalTrack::Published { muted, .. } => Some(*muted),
|
LocalTrack::Published { muted, .. } => Some(*muted),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue