diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index a1852f2..ce9fe92 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -2295,11 +2295,15 @@ impl Yumush { } pub(super) fn set_muted(&mut self, value: bool, cx: &mut Context) { + self.set_call_muted(value); + cx.notify(); + } + + pub(super) fn set_call_muted(&mut self, value: bool) { if let VoiceState::In { muted, .. } = &mut self.chat.voice_state { *muted = value; self.network.set_muted(value); } - cx.notify(); } fn confirm_ghost_speak(&mut self, window: &mut Window, cx: &mut Context) { diff --git a/crates/client/src/gui/voice_settings.rs b/crates/client/src/gui/voice_settings.rs index 1870e07..e326ad8 100644 --- a/crates/client/src/gui/voice_settings.rs +++ b/crates/client/src/gui/voice_settings.rs @@ -43,6 +43,7 @@ pub(super) enum Side { pub(super) enum MicTest { Off, On, + MutingCall, } #[derive(Clone, Copy, PartialEq, Eq)] @@ -269,9 +270,7 @@ impl Yumush { ), ]; - if self.chat.voice_community().is_none() { - rows.push(row("Test", self.test_control(entity, palette))); - } + rows.push(row("Test", self.test_control(entity, palette))); match voice.activation { Activation::VoiceActivity => { rows.push(row("Sensitivity", self.sensitivity_control(palette))) @@ -286,7 +285,7 @@ impl Yumush { } fn test_control(&self, entity: &Entity, palette: Palette) -> Div { - let testing = self.voice.mic_test == MicTest::On; + let testing = self.voice.mic_test != MicTest::Off; let mic = entity.clone(); let speaker = entity.clone(); @@ -473,10 +472,15 @@ impl Yumush { pub(super) fn toggle_mic_test(&mut self, cx: &mut Context) { match self.voice.mic_test { - MicTest::On => self.stop_mic_test(), + MicTest::On | MicTest::MutingCall => self.stop_mic_test(), MicTest::Off => { self.network.start_mic_test(&self.settings.voice); - self.voice.mic_test = MicTest::On; + self.voice.mic_test = if self.chat.voice_flags().is_some_and(|(muted, _)| !muted) { + self.set_call_muted(true); + MicTest::MutingCall + } else { + MicTest::On + }; self.start_level_poll(cx); } } @@ -485,6 +489,9 @@ impl Yumush { pub(super) fn stop_mic_test(&mut self) { self.network.stop_mic_test(); + if self.voice.mic_test == MicTest::MutingCall { + self.set_call_muted(false); + } self.voice.mic_test = MicTest::Off; self.voice.level_poll = None; }