Make Linux audio public (#23191)

Release Notes:

- Added a way to use audio in rooms with Linux builds
This commit is contained in:
Kirill Bulatov 2025-01-15 20:54:32 +02:00 committed by GitHub
parent e215ca1d99
commit 2e959cb6d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 15 deletions

View file

@ -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

View file

@ -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(()))

View file

@ -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,