Skip to content

Commit

Permalink
Merge pull request bigbluebutton#9334 from antobinary/recover-present…
Browse files Browse the repository at this point in the history
…ation-token-denied

Switch setPresenterInPodReqMsg to in-file function, not method
  • Loading branch information
antobinary authored Apr 29, 2020
2 parents d99d780 + dc0c2f7 commit df35c6f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
import { Meteor } from 'meteor/meteor';
import setPresenterInPodReqMsg from './methods/setPresenterInPodReqMsg';

Meteor.methods({
setPresenterInPodReqMsg,
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
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;
Expand Down

0 comments on commit df35c6f

Please sign in to comment.