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

24 lines
709 B
JavaScript
Raw Normal View History

2017-10-12 05:52:19 +08:00
import Screenshare from '/imports/api/2.0/screenshare';
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
2017-06-01 01:54:43 +08:00
import mapToAcl from '/imports/startup/mapToAcl';
2016-05-07 04:15:47 +08:00
2017-10-12 05:52:19 +08:00
function screenshare(credentials) {
const { meetingId, requesterUserId } = credentials;
check(meetingId, String);
check(requesterUserId, String);
2017-06-06 03:12:06 +08:00
2017-10-12 05:52:19 +08:00
Logger.info(`Publishing Screenshare for ${meetingId} ${requesterUserId}`);
return Screenshare.find({ meetingId });
}
2017-06-06 03:12:06 +08:00
function publish(...args) {
2017-10-12 05:52:19 +08:00
const boundScreenshare = screenshare.bind(this);
return mapToAcl('subscriptions.screenshare', boundScreenshare)(args);
2017-06-06 03:12:06 +08:00
}
2017-10-12 05:52:19 +08:00
Meteor.publish('screenshare', publish);