This commit is contained in:
Mikayla Maki 2023-06-20 12:36:36 -07:00
parent b828a74ad6
commit dbd95e35cf
No known key found for this signature in database
4 changed files with 17 additions and 17 deletions

View file

@ -12,8 +12,8 @@ mod sharing_status_indicator;
use call::{ActiveCall, Room}; use call::{ActiveCall, Room};
pub use collab_titlebar_item::{CollabTitlebarItem, ToggleContactsMenu}; pub use collab_titlebar_item::{CollabTitlebarItem, ToggleContactsMenu};
use gpui::{actions, AppContext, Task}; use gpui::{actions, AppContext, Task};
use util::ResultExt;
use std::sync::Arc; use std::sync::Arc;
use util::ResultExt;
use workspace::AppState; use workspace::AppState;
actions!(collab, [ToggleScreenSharing, ToggleMute, ToggleDeafen]); actions!(collab, [ToggleScreenSharing, ToggleMute, ToggleDeafen]);
@ -47,12 +47,16 @@ pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) {
pub fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) { pub fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) {
if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() { 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(); room.update(cx, Room::toggle_mute)
.map(|task| task.detach_and_log_err(cx))
.log_err();
} }
} }
pub fn toggle_deafen(_: &ToggleDeafen, cx: &mut AppContext) { pub fn toggle_deafen(_: &ToggleDeafen, cx: &mut AppContext) {
if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() { if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {
room.update(cx, Room::toggle_deafen).map(|task| task.detach_and_log_err(cx)).log_err(); room.update(cx, Room::toggle_deafen)
.map(|task| task.detach_and_log_err(cx))
.log_err();
} }
} }

View file

@ -7,12 +7,13 @@ use std::{
fmt::{self, Display}, fmt::{self, Display},
marker::PhantomData, marker::PhantomData,
mem, mem,
panic::Location,
pin::Pin, pin::Pin,
rc::Rc, rc::Rc,
sync::Arc, sync::Arc,
task::{Context, Poll}, task::{Context, Poll},
thread, thread,
time::Duration, panic::Location, time::Duration,
}; };
use crate::{ use crate::{

View file

@ -326,7 +326,10 @@ impl Room {
} }
} }
pub fn remote_audio_track_publications(&self, participant_id: &str) -> Vec<Arc<RemoteTrackPublication>> { pub fn remote_audio_track_publications(
&self,
participant_id: &str,
) -> Vec<Arc<RemoteTrackPublication>> {
unsafe { unsafe {
let tracks = LKRoomAudioTrackPublicationsForRemoteParticipant( let tracks = LKRoomAudioTrackPublicationsForRemoteParticipant(
self.native_room, self.native_room,
@ -348,7 +351,6 @@ impl Room {
} }
} }
pub fn remote_audio_track_updates(&self) -> mpsc::UnboundedReceiver<RemoteAudioTrackUpdate> { pub fn remote_audio_track_updates(&self) -> mpsc::UnboundedReceiver<RemoteAudioTrackUpdate> {
let (tx, rx) = mpsc::unbounded(); let (tx, rx) = mpsc::unbounded();
self.remote_audio_track_subscribers.lock().push(tx); self.remote_audio_track_subscribers.lock().push(tx);
@ -629,7 +631,6 @@ impl Drop for RemoteTrackPublication {
} }
} }
#[derive(Debug)] #[derive(Debug)]
pub struct RemoteAudioTrack { pub struct RemoteAudioTrack {
_native_track: *const c_void, _native_track: *const c_void,
@ -658,15 +659,11 @@ impl RemoteAudioTrack {
} }
pub fn enable(&self) -> impl Future<Output = Result<()>> { pub fn enable(&self) -> impl Future<Output = Result<()>> {
async { async { Ok(()) }
Ok(())
}
} }
pub fn disable(&self) -> impl Future<Output = Result<()>> { pub fn disable(&self) -> impl Future<Output = Result<()>> {
async { async { Ok(()) }
Ok(())
}
} }
} }

View file

@ -423,9 +423,7 @@ impl Room {
.unwrap() .unwrap()
.into_iter() .into_iter()
.filter(|track| track.publisher_id() == publisher_id) .filter(|track| track.publisher_id() == publisher_id)
.map(|_track| { .map(|_track| Arc::new(RemoteTrackPublication {}))
Arc::new(RemoteTrackPublication {})
})
.collect() .collect()
} }