Skip to content
Snippets Groups Projects
Commit dc0c2f7b authored by Anton Georgiev's avatar Anton Georgiev
Browse files

switch setPresenterInPodReqMsg to in-file function, not method

parent d99d780d
No related branches found
No related tags found
No related merge requests found
import { Meteor } from 'meteor/meteor';
import setPresenterInPodReqMsg from './methods/setPresenterInPodReqMsg';
Meteor.methods({
setPresenterInPodReqMsg,
});
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
import { extractCredentials } from '/imports/api/common/server/helpers';
export default function setPresenterInPodReqMsg(credentials) { // TODO-- switch to meetingId, etc
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'SetPresenterInPodReqMsg';
const { presenterId } = credentials;
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(requesterUserId, String);
check(presenterId, String);
const payload = {
podId: 'DEFAULT_PRESENTATION_POD',
nextPresenterId: presenterId,
};
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}
import Users from '/imports/api/users';
import PresentationPods from '/imports/api/presentation-pods';
import changePresenter from '/imports/api/users/server/modifiers/changePresenter';
import setPresenterInPodReqMsg from '/imports/api/presentation-pods/server/methods/setPresenterInPodReqMsg';
import RedisPubSub from '/imports/startup/server/redis';
function setPresenterInPodReqMsg(credentials) { // TODO-- switch to meetingId, etc
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'SetPresenterInPodReqMsg';
const { meetingId, requesterUserId, presenterId } = credentials;
const payload = {
podId: 'DEFAULT_PRESENTATION_POD',
nextPresenterId: presenterId,
};
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}
export default function handlePresenterAssigned({ body }, meetingId) {
const { presenterId, assignedBy } = body;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment