bigbluebutton-Github/bigbluebutton-html5/imports/api/network-information/server/publisher.js

23 lines
599 B
JavaScript
Raw Normal View History

2019-04-19 05:15:48 +08:00
import { Meteor } from 'meteor/meteor';
import NetworkInformation from '/imports/api/network-information';
import { extractCredentials } from '/imports/api/common/server/helpers';
2019-04-19 05:15:48 +08:00
function networkInformation() {
if (!this.userId) {
return NetworkInformation.find({ meetingId: '' });
}
const { meetingId } = extractCredentials(this.userId);
2019-04-19 05:15:48 +08:00
return NetworkInformation.find({
meetingId,
});
}
function publish(...args) {
const boundNetworkInformation = networkInformation.bind(this);
return boundNetworkInformation(...args);
}
Meteor.publish('network-information', publish);