Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(breakout-rooms): moderation of visibility #2513

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions modules/xmpp/BreakoutRooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const FEATURE_KEY = 'features/breakout-rooms';
const BREAKOUT_ROOM_ACTIONS = {
ADD: `${FEATURE_KEY}/add`,
MOVE_TO_ROOM: `${FEATURE_KEY}/move-to-room`,
PUBLISH: `${FEATURE_KEY}/publish`,
REMOVE: `${FEATURE_KEY}/remove`,
RENAME: `${FEATURE_KEY}/rename`
};
Expand Down Expand Up @@ -108,6 +109,27 @@ export default class BreakoutRooms {
this._sendMessage(message);
}

/**
* Set whether breakout rooms should be published to participants.
*
* @param {boolean} published - Whether the breakout rooms should be published.
*/
publish(published = true) {
if (!this.isSupported() || !this.room.isModerator()) {
logger.error(`Cannot publish breakout rooms - supported:${this.isSupported()},
moderator:${this.room.isModerator()}`);

return;
}

const message = {
type: BREAKOUT_ROOM_ACTIONS.PUBLISH,
published
};

this._sendMessage(message);
}

/**
* Sends the given participant to the given room.
*
Expand Down
7 changes: 5 additions & 2 deletions modules/xmpp/xmpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ export default class XMPP extends Listenable {
/**
* Process received identities.
* @param {Set<String>} identities The identities to process.
* @param {Set<String>} features The features to process, optional. If missing lobby component will be queried
* for more features.
* @param {Set<String>} features The features to process, optional. If missing lobby and breakout rooms
* components will be queried for more features.
* @private
*/
_processDiscoInfoIdentities(identities, features) {
Expand Down Expand Up @@ -483,6 +483,9 @@ export default class XMPP extends Listenable {
if (fr.endsWith('#rename')) {
this.breakoutRoomsFeatures.rename = true;
}
if (fr.endsWith('#publish')) {
this.breakoutRoomsFeatures.publish = true;
}
});
};

Expand Down