2017-10-12 10:00:28 +08:00
|
|
|
import Captions from '/imports/api/captions';
|
2017-01-18 20:53:33 +08:00
|
|
|
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
|
|
|
function captions(credentials) {
|
2019-05-17 04:11:10 +08:00
|
|
|
const { meetingId } = credentials;
|
2017-01-18 20:53:33 +08:00
|
|
|
|
|
|
|
check(meetingId, String);
|
|
|
|
|
2019-05-17 04:11:10 +08:00
|
|
|
Logger.debug(`Publishing Captions for ${meetingId}`);
|
2017-01-18 20:53:33 +08:00
|
|
|
|
|
|
|
return Captions.find({ meetingId });
|
2017-06-06 03:12:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function publish(...args) {
|
|
|
|
const boundCaptions = captions.bind(this);
|
2018-11-06 03:30:37 +08:00
|
|
|
return boundCaptions(...args);
|
2017-06-06 03:12:06 +08:00
|
|
|
}
|
|
|
|
|
2017-10-13 03:07:02 +08:00
|
|
|
Meteor.publish('captions', publish);
|