Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add microphone events to calls
Joseph T. Lyons429daf5f8cba
diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rsindex dbdeb45573e..7d1aa5d1b0f 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();}}