Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add deafen and mute stubs
Mikayla Makiecd2129c2f48
diff --git a/crates/call/src/room.rs b/crates/call/src/room.rsindex 3b76a0bb378..aa0cb1f20ef 100644--- a/crates/call/src/room.rs+++ b/crates/call/src/room.rs@@ -1143,6 +1143,17 @@ impl Room {})}+ pub fn toggle_mute(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {+ // https://docs.livekit.io/client/publish/+ // Should be acessible from local participant / publication+ todo!();+ }++ pub fn toggle_deafen(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {+ // iterate through publications and mute (?????)+ todo!();+ }+pub fn unshare_screen(&mut self, cx: &mut ModelContext<Self>) -> Result<()> {if self.status.is_offline() {return Err(anyhow!("room is offline"));diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rsindex c0734388b15..9a426b0879f 100644--- a/crates/collab_ui/src/collab_ui.rs+++ b/crates/collab_ui/src/collab_ui.rs@@ -15,7 +15,7 @@ use gpui::{actions, AppContext, Task};use std::sync::Arc;use workspace::AppState;-actions!(collab, [ToggleScreenSharing]);+actions!(collab, [ToggleScreenSharing, ToggleMute, ToggleDeafen]);pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {collab_titlebar_item::init(cx);@@ -27,6 +27,8 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {sharing_status_indicator::init(cx);cx.add_global_action(toggle_screen_sharing);+ cx.add_global_action(toggle_mute);+ cx.add_global_action(toggle_deafen);}pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) {@@ -41,3 +43,25 @@ pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) {toggle_screen_sharing.detach_and_log_err(cx);}}++pub fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) {+ if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {+ let toggle_mut = room.update(cx, |room, cx| {+ if room.is_sharing_mic() {+ room.toggle_mute(cx)+ } else {+ room.share_mic(cx)+ }+ });+ toggle_mut.detach_and_log_err(cx);+ }+}++pub fn toggle_deafen(_: &ToggleDeafen, cx: &mut AppContext) {+ if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {+ let toggle_deafan = room.update(cx, |room, cx| {+ room.toggle_deafen(cx)+ });+ toggle_deafan.detach_and_log_err(cx);+ }+}