Skip to content

Instantly share code, notes, and snippets.

@sarahbanas
Created July 19, 2020 01:45
Show Gist options
  • Save sarahbanas/ca602c20673354b2ca01ba3201025a55 to your computer and use it in GitHub Desktop.
Save sarahbanas/ca602c20673354b2ca01ba3201025a55 to your computer and use it in GitHub Desktop.
Jitsi issue: when a moderator leaves, the room still exists and participants stick around. Fix: replace original USER_LEFT (around line 1988) with the function below. It will kick all users out and leave/disconnect the room.
room.on(JitsiConferenceEvents.USER_LEFT, (id, user) => {
// The logic shared between RN and web.
commonUserLeftHandling(APP.store, room, user);
// if user is a moderator, kick everyone out
if(user.isModerator) {
let participants = APP.conference.listMembers();
participants.forEach(participant => {
APP.store.dispatch(kickedOut(room, participant));
this.leaveRoomAndDisconnect();
});
this.leaveRoomAndDisconnect();
}
if (user.isHidden()) {
return;
}
logger.log(`USER ${id} LEFT:`, user);
APP.UI.onSharedVideoStop(id);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment