use std::collections::BTreeSet;
use opentalk_roomserver_signaling::signaling_module::InternalCommand;
use opentalk_types_signaling::ParticipantId;
use tokio::sync::oneshot;
use crate::MicrophoneRestrictionState;
#[derive(Debug)]
pub enum LiveKitInternal {
Mute {
sender: Option<ParticipantId>,
participants: BTreeSet<ParticipantId>,
return_channel: oneshot::Sender<ParticipantsMuted>,
},
UpdateMicrophoneRestrictions {
sender: ParticipantId,
new_state: MicrophoneRestrictionState,
return_channel:
oneshot::Sender<Result<MicrophoneRestrictionState, MicrophoneRestrictionError>>,
},
}
#[derive(Debug)]
pub enum MicrophoneRestrictionErrorKind {
ConflictingTask,
LivekitUnavailable,
}
#[derive(Debug)]
pub struct MicrophoneRestrictionError {
pub sender: ParticipantId,
pub error: MicrophoneRestrictionErrorKind,
}
#[derive(Debug)]
pub struct ParticipantsMuted {
pub sender: Option<ParticipantId>,
pub participants: BTreeSet<ParticipantId>,
}
impl InternalCommand for LiveKitInternal {}