Release Notes: - Added a way to use audio in rooms with Linux builds
Unified · Split
| @@ -2039,7 +2039,6 @@ dependencies = [ · 2038 unmodified lines | |||
| 2039 | "audio", | 2039 | "audio", |
| 2040 | "client", | 2040 | "client", |
| 2041 | "collections", | 2041 | "collections", |
| 2042 | "feature_flags", | ||
| 2043 | "fs", | 2042 | "fs", |
| 2044 | "futures 0.3.31", | 2043 | "futures 0.3.31", |
| 2045 | "gpui", | 2044 | "gpui", |
| @@ -28,7 +28,6 @@ anyhow.workspace = true · 27 unmodified lines | |||
| 28 | audio.workspace = true | 28 | audio.workspace = true |
| 29 | client.workspace = true | 29 | client.workspace = true |
| 30 | collections.workspace = true | 30 | collections.workspace = true |
| 31 | feature_flags.workspace = true | ||
| 32 | fs.workspace = true | 31 | fs.workspace = true |
| 33 | futures.workspace = true | 32 | futures.workspace = true |
| 34 | gpui.workspace = true | 33 | gpui.workspace = true |
| @@ -1304,13 +1304,12 @@ impl Room { · 1303 unmodified lines | |||
| 1304 | self.live_kit.as_ref().map(|live_kit| live_kit.deafened) | 1304 | self.live_kit.as_ref().map(|live_kit| live_kit.deafened) |
| 1305 | } | 1305 | } |
| 1306 | 1306 | ||
| 1307 | pub fn can_use_microphone(&self, _cx: &AppContext) -> bool { | 1307 | pub fn can_use_microphone(&self) -> bool { |
| 1308 | use proto::ChannelRole::*; | 1308 | use proto::ChannelRole::*; |
| 1309 | 1309 | ||
| 1310 | #[cfg(not(any(test, feature = "test-support")))] | 1310 | #[cfg(not(any(test, feature = "test-support")))] |
| 1311 | { | 1311 | { |
| 1312 | use feature_flags::FeatureFlagAppExt as _; | 1312 | if cfg!(target_os = "windows") { |
| 1313 | if cfg!(target_os = "windows") || (cfg!(target_os = "linux") && !_cx.is_staff()) { | ||
| 1314 | return false; | 1313 | return false; |
| 1315 | } | 1314 | } |
| 1316 | } | 1315 | } |
| @@ -1684,7 +1683,7 @@ fn spawn_room_connection( · 367 unmodified lines | |||
| 1684 | _handle_updates, | 1683 | _handle_updates, |
| 1685 | }); | 1684 | }); |
| 1686 | 1685 | ||
| 1687 | if !muted_by_user && this.can_use_microphone(cx) { | 1686 | if !muted_by_user && this.can_use_microphone() { |
| 1688 | this.share_microphone(cx) | 1687 | this.share_microphone(cx) |
| 1689 | } else { | 1688 | } else { |
| 1690 | Task::ready(Ok(())) | 1689 | Task::ready(Ok(())) |
| @@ -156,7 +156,7 @@ impl Room { · 155 unmodified lines | |||
| 156 | cx.spawn(|this, mut cx| async move { | 156 | cx.spawn(|this, mut cx| async move { |
| 157 | connect.await?; | 157 | connect.await?; |
| 158 | this.update(&mut cx, |this, cx| { | 158 | this.update(&mut cx, |this, cx| { |
| 159 | if this.can_use_microphone(cx) { | 159 | if this.can_use_microphone() { |
| 160 | if let Some(live_kit) = &this.live_kit { | 160 | if let Some(live_kit) = &this.live_kit { |
| 161 | if !live_kit.muted_by_user && !live_kit.deafened { | 161 | if !live_kit.muted_by_user && !live_kit.deafened { |
| 162 | return this.share_microphone(cx); | 162 | return this.share_microphone(cx); |
| @@ -1323,7 +1323,7 @@ impl Room { · 1160 unmodified lines | |||
| 1323 | self.live_kit.as_ref().map(|live_kit| live_kit.deafened) | 1323 | self.live_kit.as_ref().map(|live_kit| live_kit.deafened) |
| 1324 | } | 1324 | } |
| 1325 | 1325 | ||
| 1326 | pub fn can_use_microphone(&self, _cx: &AppContext) -> bool { | 1326 | pub fn can_use_microphone(&self) -> bool { |
| 1327 | use proto::ChannelRole::*; | 1327 | use proto::ChannelRole::*; |
| 1328 | match self.local_participant.role { | 1328 | match self.local_participant.role { |
| 1329 | Admin | Member | Talker => true, | 1329 | Admin | Member | Talker => true, |
| @@ -108,7 +108,7 @@ async fn test_channel_guest_promotion(cx_a: &mut TestAppContext, cx_b: &mut Test · 107 unmodified lines | |||
| 108 | assert!(project_b.read_with(cx_b, |project, cx| project.is_read_only(cx))); | 108 | assert!(project_b.read_with(cx_b, |project, cx| project.is_read_only(cx))); |
| 109 | assert!(editor_b.update(cx_b, |e, cx| e.read_only(cx))); | 109 | assert!(editor_b.update(cx_b, |e, cx| e.read_only(cx))); |
| 110 | cx_b.update(|cx_b| { | 110 | cx_b.update(|cx_b| { |
| 111 | assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx))); | 111 | assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone())); |
| 112 | }); | 112 | }); |
| 113 | assert!(room_b | 113 | assert!(room_b |
| 114 | .update(cx_b, |room, cx| room.share_microphone(cx)) | 114 | .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 · 21 unmodified lines | |||
| 136 | 136 | ||
| 137 | // B sees themselves as muted, and can unmute. | 137 | // B sees themselves as muted, and can unmute. |
| 138 | cx_b.update(|cx_b| { | 138 | cx_b.update(|cx_b| { |
| 139 | assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx))); | 139 | assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone())); |
| 140 | }); | 140 | }); |
| 141 | room_b.read_with(cx_b, |room, _| assert!(room.is_muted())); | 141 | room_b.read_with(cx_b, |room, _| assert!(room.is_muted())); |
| 142 | room_b.update(cx_b, |room, cx| room.toggle_mute(cx)); | 142 | 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 · 88 unmodified lines | |||
| 231 | .read(ActiveCall::global) | 231 | .read(ActiveCall::global) |
| 232 | .update(cx_b, |call, _| call.room().unwrap().clone()); | 232 | .update(cx_b, |call, _| call.room().unwrap().clone()); |
| 233 | cx_b.update(|cx_b| { | 233 | cx_b.update(|cx_b| { |
| 234 | assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx))); | 234 | assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone())); |
| 235 | }); | 235 | }); |
| 236 | 236 | ||
| 237 | // A tries to grant write access to B, but cannot because B has not | 237 | // 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 · 13 unmodified lines | |||
| 251 | cx_a.run_until_parked(); | 251 | cx_a.run_until_parked(); |
| 252 | assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects())); | 252 | assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects())); |
| 253 | cx_b.update(|cx_b| { | 253 | cx_b.update(|cx_b| { |
| 254 | assert!(room_b.read_with(cx_b, |room, cx| !room.can_use_microphone(cx))); | 254 | assert!(room_b.read_with(cx_b, |room, _| !room.can_use_microphone())); |
| 255 | }); | 255 | }); |
| 256 | 256 | ||
| 257 | // A tries to grant write access to B, but cannot because B has not | 257 | // 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 · 13 unmodified lines | |||
| 271 | cx_a.run_until_parked(); | 271 | cx_a.run_until_parked(); |
| 272 | assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects())); | 272 | assert!(room_b.read_with(cx_b, |room, _| !room.can_share_projects())); |
| 273 | cx_b.update(|cx_b| { | 273 | cx_b.update(|cx_b| { |
| 274 | assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx))); | 274 | assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone())); |
| 275 | }); | 275 | }); |
| 276 | 276 | ||
| 277 | // User B signs the zed CLA. | 277 | // 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 · 20 unmodified lines | |||
| 298 | cx_a.run_until_parked(); | 298 | cx_a.run_until_parked(); |
| 299 | assert!(room_b.read_with(cx_b, |room, _| room.can_share_projects())); | 299 | assert!(room_b.read_with(cx_b, |room, _| room.can_share_projects())); |
| 300 | cx_b.update(|cx_b| { | 300 | cx_b.update(|cx_b| { |
| 301 | assert!(room_b.read_with(cx_b, |room, cx| room.can_use_microphone(cx))); | 301 | assert!(room_b.read_with(cx_b, |room, _| room.can_use_microphone())); |
| 302 | }); | 302 | }); |
| 303 | } | 303 | } |
| @@ -295,7 +295,7 @@ impl TitleBar { · 294 unmodified lines | |||
| 295 | let muted_by_user = room.muted_by_user(); | 295 | let muted_by_user = room.muted_by_user(); |
| 296 | let is_deafened = room.is_deafened().unwrap_or(false); | 296 | let is_deafened = room.is_deafened().unwrap_or(false); |
| 297 | let is_screen_sharing = room.is_screen_sharing(); | 297 | let is_screen_sharing = room.is_screen_sharing(); |
| 298 | let can_use_microphone = room.can_use_microphone(cx); | 298 | let can_use_microphone = room.can_use_microphone(); |
| 299 | let can_share_projects = room.can_share_projects(); | 299 | let can_share_projects = room.can_share_projects(); |
| 300 | let screen_sharing_supported = match self.platform_style { | 300 | let screen_sharing_supported = match self.platform_style { |
| 301 | PlatformStyle::Mac => true, | 301 | PlatformStyle::Mac => true, |