bigbluebutton-Github/bigbluebutton-html5/imports/api/breakouts/server/methods/requestJoinURL.js

32 lines
992 B
JavaScript
Raw Normal View History

import { Meteor } from 'meteor/meteor';
import RedisPubSub from '/imports/startup/server/redis';
import { extractCredentials } from '/imports/api/common/server/helpers';
import { check } from 'meteor/check';
2021-05-05 00:25:02 +08:00
import Logger from '/imports/startup/server/logger';
export default function requestJoinURL({ breakoutId, userId: userIdToInvite }) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
2021-05-05 00:25:02 +08:00
const EVENT_NAME = 'RequestBreakoutJoinURLReqMsg';
2021-05-05 00:25:02 +08:00
try {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
2021-05-05 00:25:02 +08:00
check(meetingId, String);
check(requesterUserId, String);
2021-05-05 00:25:02 +08:00
const userId = userIdToInvite || requesterUserId;
2018-12-28 00:20:03 +08:00
2021-05-05 00:25:02 +08:00
return RedisPubSub.publishUserMessage(
CHANNEL, EVENT_NAME, meetingId, requesterUserId,
{
meetingId,
breakoutId,
userId,
},
);
} catch (err) {
Logger.error(`Exception while invoking method requestJoinURL ${err.stack}`);
}
}