bigbluebutton-Github/bigbluebutton-html5/imports/api/meetings/server/methods/endMeeting.js
2020-10-14 09:44:17 -04:00

19 lines
728 B
JavaScript

import { Meteor } from 'meteor/meteor';
import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
export default function endMeeting() {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'LogoutAndEndMeetingCmdMsg';
const { meetingId, requesterUserId } = extractCredentials(this.userId);
const payload = {
userId: requesterUserId,
};
Logger.warn(`Meeting '${meetingId}' is destroyed by '${requesterUserId}'`);
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}