From fb0a19149362eaf526ec61e91e33f357c2cdff8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sat, 28 Nov 2026 02:34:07 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Hear=20yourself=20works=20d?= =?UTF-8?q?uring=20a=20call:=20it=20mutes=20you=20in=20the=20call=20while?= =?UTF-8?q?=20testing=20and=20unmutes=20when=20the=20test=20stops=20(only?= =?UTF-8?q?=20if=20it=20did=20the=20muting)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 6 +++++- crates/client/src/gui/voice_settings.rs | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) 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; }