mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-09 21:26:14 +03:00
Add is_muted and is_deafened
This commit is contained in:
parent
cf4251fb55
commit
8273e08d4a
@ -1000,6 +1000,22 @@ impl Room {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn is_muted(&self) -> Option<bool> {
|
||||
self.live_kit.as_ref().and_then(|live_kit| {
|
||||
match &live_kit.microphone_track {
|
||||
LocalTrack::None => None,
|
||||
LocalTrack::Pending { muted, .. } => Some(*muted),
|
||||
LocalTrack::Published { muted, .. } => Some(*muted),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn is_deafened(&self) -> Option<bool> {
|
||||
self.live_kit.as_ref().map(|live_kit| {
|
||||
live_kit.deafened
|
||||
})
|
||||
}
|
||||
|
||||
pub fn share_mic(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
||||
if self.status.is_offline() {
|
||||
return Task::ready(Err(anyhow!("room is offline")));
|
||||
|
Loading…
Reference in New Issue
Block a user