Removes a participant from the room if the user has the appropriate permissions.
This method checks the current user's level and their co-host responsibilities
to determine if they are allowed to remove a specified participant. If allowed,
the method emits a socket event to disconnect the participant and updates
the local list of participants. If not allowed, an alert is displayed.
Param: options
The options for removing a participant.
Param: options.coHostResponsibility
The responsibilities of the co-host.
Param: options.participant
The participant to be removed.
Param: options.member
The current member attempting to remove the participant.
Param: options.islevel
The level of the current member.
Param: options.showAlert
Optional function to show alert messages.
Param: options.coHost
The co-host information.
Param: options.participants
The list of current participants.
Param: options.socket
The socket instance for emitting events.
Param: options.roomName
The name of the room.
Param: options.updateParticipants
Function to update the participants list.
Returns
A promise that resolves when the participant is removed.
Throws
Will log an error if there is an issue accessing co-host responsibilities.
Removes a participant from the room if the user has the appropriate permissions.
This method checks the current user's level and their co-host responsibilities to determine if they are allowed to remove a specified participant. If allowed, the method emits a socket event to disconnect the participant and updates the local list of participants. If not allowed, an alert is displayed.
Param: options
The options for removing a participant.
Param: options.coHostResponsibility
The responsibilities of the co-host.
Param: options.participant
The participant to be removed.
Param: options.member
The current member attempting to remove the participant.
Param: options.islevel
The level of the current member.
Param: options.showAlert
Optional function to show alert messages.
Param: options.coHost
The co-host information.
Param: options.participants
The list of current participants.
Param: options.socket
The socket instance for emitting events.
Param: options.roomName
The name of the room.
Param: options.updateParticipants
Function to update the participants list.
Returns
A promise that resolves when the participant is removed.
Throws
Will log an error if there is an issue accessing co-host responsibilities.
Example