Add microphone events to calls
This commit is contained in:
parent
7d3d54652b
commit
429daf5f8c
1 changed files with 17 additions and 3 deletions
|
@ -64,10 +64,24 @@ 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) {
|
||||||
|
let call = ActiveCall::global(cx).read(cx);
|
||||||
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)
|
let client = call.client();
|
||||||
.map(|task| task.detach_and_log_err(cx))
|
room.update(cx, |room, cx| {
|
||||||
.log_err();
|
if room.is_muted() {
|
||||||
|
ActiveCall::report_call_event_for_room("enable microphone", room.id(), &client, cx);
|
||||||
|
} else {
|
||||||
|
ActiveCall::report_call_event_for_room(
|
||||||
|
"disable microphone",
|
||||||
|
room.id(),
|
||||||
|
&client,
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
room.toggle_mute(cx)
|
||||||
|
})
|
||||||
|
.map(|task| task.detach_and_log_err(cx))
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue