From ff2ed3da8b7d668eba36b7a7183458df86071578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 25 Nov 2026 15:44:51 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20resync=20voice=20and=20sh?= =?UTF-8?q?ares=20after=20reconnecting=20and=20always=20rejoin=20the=20cal?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/chat.rs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 2a77a1e..56f092b 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -1608,13 +1608,17 @@ impl Yumush { self.select_community(community_id, window, cx); } - pub(super) fn reload(&self, window: &mut Window, cx: &mut Context) { + pub(super) fn reload(&mut self, window: &mut Window, cx: &mut Context) { + self.chat.voice.clear(); + self.chat.shares.clear(); self.load_communities(window, cx); self.load_social(window, cx); - if self.chat.selected_community_id.is_some() { + if let Some(community_id) = self.chat.selected_community_id.clone() { self.load_members(window, cx); self.load_messages(None, window, cx); + self.load_voice(window, cx); + self.load_shares(community_id, cx); } } @@ -2042,20 +2046,7 @@ impl Yumush { }; let flags = self.chat.voice_flags().unwrap_or((false, false)); self.chat.set_voice_off(); - let network = self.network.clone(); - - cx.spawn_in(window, async move |this, cx| { - let Ok(participants) = network.voice_participants(&community_id).await else { - return; - }; - let _ = this.update_in(cx, |yumush, window, cx| { - if participants.iter().any(|id| !yumush.is_me(id)) { - yumush.join_voice(community_id, flags, false, window, cx); - } - cx.notify(); - }); - }) - .detach(); + self.join_voice(community_id, flags, false, window, cx); } pub(super) fn leave_voice_in(&mut self, community_id: &str, cx: &mut Context) {