Conversation - Moderation
Here is a description of how to moderate private conference: accept / decline users.
If you're joining private conversation (conference) you should be accepted by moderator of this conversation:
connectedConversation.join() .then(function (response) { // if you're accepted }).catch(function (err) { // if you're not allowed promise resolved with appropriate error });
As non-moderator user you can listen `waitingForModeratorAcceptance` event to be notified when you need to wait for moderator confirmation:
conversation.on('waitingForModeratorAcceptance', function (moderator) { });
On the moderator side you should listen `conversationJoinRequest` event and then handle ReceivedConversationJoinRequest object:
connectedSession.on('conversationJoinRequest', function (request) { // To accept: joinRequest.accept() .then(function () { }) .catch(function (err) { }); // To decline: joinRequest.decline() .then(function () { }) .catch(function (err) { }); });
You can listen for `participantEjected` event on any user side to be notified about user ejection by moderator:
conversation.on('participantEjected', function (data) { if (data.self) { // Handle if myself } });