2019-02-27 01:08:15 +08:00
|
|
|
import GuestUsers from '/imports/api/guest-users/';
|
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
2020-02-07 04:47:28 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2019-02-27 01:08:15 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
function guestUsers() {
|
|
|
|
if (!this.userId) {
|
|
|
|
return GuestUsers.find({ meetingId: '' });
|
|
|
|
}
|
2019-02-27 01:08:15 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2019-02-27 01:08:15 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
Logger.info(`Publishing Slides for ${meetingId} ${requesterUserId}`);
|
2019-02-27 01:08:15 +08:00
|
|
|
|
|
|
|
return GuestUsers.find({ meetingId });
|
|
|
|
}
|
|
|
|
|
|
|
|
function publish(...args) {
|
|
|
|
const boundSlides = guestUsers.bind(this);
|
|
|
|
return boundSlides(...args);
|
|
|
|
}
|
|
|
|
|
|
|
|
Meteor.publish('guestUser', publish);
|