2018-04-06 03:59:26 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
2018-04-10 11:57:24 +08:00
|
|
|
import PresentationPods from '/imports/api/presentation-pods';
|
2018-04-06 03:59:26 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
2020-02-07 04:47:28 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2018-04-06 03:59:26 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
function presentationPods() {
|
|
|
|
if (!this.userId) {
|
|
|
|
return PresentationPods.find({ meetingId: '' });
|
|
|
|
}
|
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
|
|
|
Logger.debug(`Publishing presentation-pods for ${meetingId} ${requesterUserId}`);
|
2018-04-06 03:59:26 +08:00
|
|
|
|
|
|
|
return PresentationPods.find({ meetingId });
|
|
|
|
}
|
|
|
|
|
|
|
|
function publish(...args) {
|
|
|
|
const boundPresentationPods = presentationPods.bind(this);
|
2018-11-06 03:30:37 +08:00
|
|
|
return boundPresentationPods(...args);
|
2018-04-06 03:59:26 +08:00
|
|
|
}
|
|
|
|
|
2018-04-10 11:57:24 +08:00
|
|
|
Meteor.publish('presentation-pods', publish);
|