bigbluebutton-Github/bigbluebutton-html5/imports/api/users-settings/server/publishers.js

23 lines
651 B
JavaScript
Raw Normal View History

import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import UserSettings from '/imports/api/users-settings';
import Logger from '/imports/startup/server/logger';
function userSettings(credentials) {
const { meetingId, requesterUserId } = credentials;
check(meetingId, String);
check(requesterUserId, String);
Logger.debug(`Publishing user settings for user=${requesterUserId}`);
return UserSettings.find({ meetingId, userId: requesterUserId });
}
function publish(...args) {
const boundUserSettings = userSettings.bind(this);
return boundUserSettings(...args);
}
Meteor.publish('users-settings', publish);