diff --git a/Cargo.lock b/Cargo.lock index 54828500eaf..cb97f23c17b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2039,7 +2039,6 @@ dependencies = [ "audio", "client", "collections", - "feature_flags", "fs", "futures 0.3.31", "gpui", diff --git a/crates/call/Cargo.toml b/crates/call/Cargo.toml index 332d494416f..8b4777b578c 100644 --- a/crates/call/Cargo.toml +++ b/crates/call/Cargo.toml @@ -28,7 +28,6 @@ anyhow.workspace = true audio.workspace = true client.workspace = true collections.workspace = true -feature_flags.workspace = true fs.workspace = true futures.workspace = true gpui.workspace = true diff --git a/crates/call/src/cross_platform/room.rs b/crates/call/src/cross_platform/room.rs index 79b993e38bf..e728968acc3 100644 --- a/crates/call/src/cross_platform/room.rs +++ b/crates/call/src/cross_platform/room.rs @@ -1304,13 +1304,12 @@ impl Room { self.live_kit.as_ref().map(|live_kit| live_kit.deafened) } - pub fn can_use_microphone(&self, _cx: &AppContext) -> bool { + pub fn can_use_microphone(&self) -> bool { use proto::ChannelRole::*; #[cfg(not(any(test, feature = "test-support")))] { - use feature_flags::FeatureFlagAppExt as _; - if cfg!(target_os = "windows") || (cfg!(target_os = "linux") && !_cx.is_staff()) { + if cfg!(target_os = "windows") { return false; } } @@ -1684,7 +1683,7 @@ fn spawn_room_connection( _handle_updates, }); - if !muted_by_user && this.can_use_microphone(cx) { + if !muted_by_user && this.can_use_microphone() { this.share_microphone(cx) } else { Task::ready(Ok(())) diff --git a/crates/call/src/macos/room.rs b/crates/call/src/macos/room.rs index 56016dca0ef..987c056437a 100644 --- a/crates/call/src/macos/room.rs +++ b/crates/call/src/macos/room.rs @@ -156,7 +156,7 @@ impl Room { cx.spawn(|this, mut cx| async move { connect.await?; this.update(&mut cx, |this, cx| { - if this.can_use_microphone(cx) { + if this.can_use_microphone() { if let Some(live_kit) = &this.live_kit { if !live_kit.muted_by_user && !live_kit.deafened { return this.share_microphone(cx); @@ -1323,7 +1323,7 @@ impl Room { self.live_kit.as_ref().map(|live_kit| live_kit.deafened) } - pub fn can_use_microphone(&self, _cx: &AppContext) -> bool { + pub fn can_use_microphone(&self) -> bool { use proto::ChannelRole::*; match self.local_participant.role { Admin | Member | Talker => true, diff --git a/crates/collab/src/tests/channel_guest_tests.rs b/crates/collab/src/tests/channel_guest_tests.rs index 006a3e5d1cf..22da44a3247 100644 --- a/crates/collab/src/tests/channel_guest_tests.rs +++ b/crates/collab/src/tests/channel_guest_tests.rs @@ -108,7 +108,7 @@ async fn test_channel_guest_promotion(cx_a: &mut TestAppContext, cx_b: &mut Test assert!(project_b.read_with(cx_b, |project, cx| project.is_read_only(cx))); assert!(editor_b.update(cx_b, |e, cx| e.read_only(cx))); cx_b.update(|cx_b| { - assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx))); + assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone())); }); assert!(room_b .update(cx_b, |room, cx| room.share_microphone(cx)) @@ -136,7 +136,7 @@ async fn test_channel_guest_promotion(cx_a: &mut TestAppContext, cx_b: &mut Test // B sees themselves as muted, and can unmute. cx_b.update(|cx_b| { - assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx))); + assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone())); }); room_b.read_with(cx_b, |room, _| assert!(room.is_muted())); room_b.update(cx_b, |room, cx| room.toggle_mute(cx)); @@ -231,7 +231,7 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes .read(ActiveCall::global) .update(cx_b, |call, _| call.room().unwrap().clone()); cx_b.update(|cx_b| { - assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx))); + assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone())); }); // A tries to grant write access to B, but cannot because B has not @@ -251,7 +251,7 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes cx_a.run_until_parked(); assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects())); cx_b.update(|cx_b| { - assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx))); + assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone())); }); // A tries to grant write access to B, but cannot because B has not @@ -271,7 +271,7 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes cx_a.run_until_parked(); assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects())); cx_b.update(|cx_b| { - assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx))); + assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone())); }); // User B signs the zed CLA. @@ -298,6 +298,6 @@ async fn test_channel_requires_zed_cla(cx_a: &mut TestAppContext, cx_b: &mut Tes cx_a.run_until_parked(); assert!(room_b.read_with(cx_b, |room, _| room.can_share_projects())); cx_b.update(|cx_b| { - assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx))); + assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone())); }); } diff --git a/crates/title_bar/src/collab.rs b/crates/title_bar/src/collab.rs index 8639e48c5eb..9f91b44754f 100644 --- a/crates/title_bar/src/collab.rs +++ b/crates/title_bar/src/collab.rs @@ -295,7 +295,7 @@ impl TitleBar { let muted_by_user = room.muted_by_user(); let is_deafened = room.is_deafened().unwrap_or(false); let is_screen_sharing = room.is_screen_sharing(); - let can_use_microphone = room.can_use_microphone(cx); + let can_use_microphone = room.can_use_microphone(); let can_share_projects = room.can_share_projects(); let screen_sharing_supported = match self.platform_style { PlatformStyle::Mac => true,