bigbluebutton-Github/bigbluebutton-html5/imports/api/presentation-upload-token/server/methods/requestPresentationUploadToken.js
2021-03-16 13:15:41 -03:00

24 lines
745 B
JavaScript

import RedisPubSub from '/imports/startup/server/redis';
import { check } from 'meteor/check';
import { extractCredentials } from '/imports/api/common/server/helpers';
export default function requestPresentationUploadToken(podId, filename) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'PresentationUploadTokenReqMsg';
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(requesterUserId, String);
check(podId, String);
check(filename, String);
const payload = {
podId,
filename,
};
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}