2019-02-21 01:17:17 +08:00
|
|
|
import RedisPubSub from '/imports/startup/server/redis';
|
|
|
|
import { check } from 'meteor/check';
|
2020-02-07 04:47:28 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2019-02-21 01:17:17 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
export default function setPresentationDownloadable(presentationId, downloadable) {
|
2019-02-21 01:17:17 +08:00
|
|
|
const REDIS_CONFIG = Meteor.settings.private.redis;
|
|
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
2019-02-21 06:20:04 +08:00
|
|
|
const EVENT_NAME = 'SetPresentationDownloadablePubMsg';
|
2019-02-21 01:17:17 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2019-02-21 01:17:17 +08:00
|
|
|
|
2019-02-21 06:20:04 +08:00
|
|
|
check(downloadable, Boolean);
|
2019-02-21 01:17:17 +08:00
|
|
|
check(presentationId, String);
|
|
|
|
|
|
|
|
const payload = {
|
|
|
|
presentationId,
|
2019-02-21 06:20:04 +08:00
|
|
|
podId: 'DEFAULT_PRESENTATION_POD',
|
|
|
|
downloadable,
|
2019-02-21 01:17:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
|
|
|
|
}
|