2018-10-24 01:18:09 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import RedisPubSub from '/imports/startup/server/redis';
|
2020-02-07 04:47:28 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2021-05-05 00:25:02 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
2018-10-24 01:18:09 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
export default function endAllBreakouts() {
|
2018-10-24 01:18:09 +08:00
|
|
|
const REDIS_CONFIG = Meteor.settings.private.redis;
|
|
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
2021-05-05 00:25:02 +08:00
|
|
|
const EVENT_NAME = 'EndAllBreakoutRoomsMsg';
|
2018-10-24 01:18:09 +08:00
|
|
|
|
2021-05-05 00:25:02 +08:00
|
|
|
try {
|
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2018-10-24 01:18:09 +08:00
|
|
|
|
2021-05-05 00:25:02 +08:00
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
2018-10-24 01:18:09 +08:00
|
|
|
|
2021-05-05 00:25:02 +08:00
|
|
|
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, null);
|
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Exception while invoking method endAllBreakouts ${err.stack}`);
|
|
|
|
}
|
2018-10-24 01:18:09 +08:00
|
|
|
}
|