bigbluebutton-Github/bigbluebutton-html5/imports/api/presentations/server/publishers.js

23 lines
695 B
JavaScript

import { Meteor } from 'meteor/meteor';
import Presentations from '/imports/api/presentations';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
function presentations() {
if (!this.userId) {
return Presentations.find({ meetingId: '' });
}
const { meetingId, requesterUserId } = extractCredentials(this.userId);
Logger.debug(`Publishing Presentations for ${meetingId} ${requesterUserId}`);
return Presentations.find({ meetingId });
}
function publish(...args) {
const boundPresentations = presentations.bind(this);
return boundPresentations(...args);
}
Meteor.publish('presentations', publish);