remove Participants
Removes a participant from the room if the user has the necessary permissions.
This function checks if the current user has the required permissions based on their level and co-host responsibilities. If authorized, it emits a socket event to remove the participant and updates the local participant list.
Example:
val options = RemoveParticipantsOptions(
coHostResponsibility = listOf(CoHostResponsibility(name = "participants", value = true)),
participant = Participant(id = "123", name = "John Doe", islevel = "1"),
member = "currentMember",
islevel = "2",
showAlert = { alert -> Logger.d("RemoveParticipants", alert.message) },
coHost = "coHostMember",
participants = listOf(Participant(id = "123", name = "John Doe", islevel = "1")),
socket = socketInstance,
roomName = "room1",
updateParticipants = { updatedParticipants -> Logger.d("RemoveParticipants", updatedParticipants) }
)
removeParticipants(options)Content copied to clipboard