From 7d3d54652bd17a3eea52d25e81459fccbde7d4bc Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Thu, 20 Jul 2023 15:54:26 -0400 Subject: [PATCH 1/2] Remove unused method --- crates/call/src/call.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/crates/call/src/call.rs b/crates/call/src/call.rs index 3fc76b964d..2defd6b40f 100644 --- a/crates/call/src/call.rs +++ b/crates/call/src/call.rs @@ -284,21 +284,6 @@ impl ActiveCall { } } - pub fn toggle_screen_sharing(&self, cx: &mut AppContext) { - if let Some(room) = self.room().cloned() { - let toggle_screen_sharing = room.update(cx, |room, cx| { - if room.is_screen_sharing() { - self.report_call_event("disable screen share", cx); - Task::ready(room.unshare_screen(cx)) - } else { - self.report_call_event("enable screen share", cx); - room.share_screen(cx) - } - }); - toggle_screen_sharing.detach_and_log_err(cx); - } - } - pub fn share_project( &mut self, project: ModelHandle, From 429daf5f8cba347937f928a30afad91eb7807bea Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Thu, 20 Jul 2023 16:00:11 -0400 Subject: [PATCH 2/2] Add microphone events to calls --- crates/collab_ui/src/collab_ui.rs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rs index dbdeb45573..7d1aa5d1b0 100644 --- a/crates/collab_ui/src/collab_ui.rs +++ b/crates/collab_ui/src/collab_ui.rs @@ -64,10 +64,24 @@ pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) { } pub fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) { + let call = ActiveCall::global(cx).read(cx); if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() { - room.update(cx, Room::toggle_mute) - .map(|task| task.detach_and_log_err(cx)) - .log_err(); + let client = call.client(); + room.update(cx, |room, cx| { + if room.is_muted() { + ActiveCall::report_call_event_for_room("enable microphone", room.id(), &client, cx); + } else { + ActiveCall::report_call_event_for_room( + "disable microphone", + room.id(), + &client, + cx, + ); + } + room.toggle_mute(cx) + }) + .map(|task| task.detach_and_log_err(cx)) + .log_err(); } }