bigbluebutton-Github/bigbluebutton-html5/imports/api/user-reaction/server/publishers.js
Max Franke d28b93a586 feat(reactions): add user reaction
add user-reaction collection
add emoji picker for user reaction in the user list
add options to enable/disable user-reaction
add a way to pass style to emoji-picker component
2023-04-27 11:54:11 -03:00

28 lines
789 B
JavaScript

import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import UserReaction from '/imports/api/user-reaction';
import { extractCredentials } from '/imports/api/common/server/helpers';
function userReaction() {
if (!this.userId) {
return UserReaction.find({ meetingId: '' });
}
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(requesterUserId, String);
Logger.info(`Publishing user reaction for ${meetingId} ${requesterUserId}`);
return UserReaction.find({ meetingId });
}
function publish(...args) {
const boundUserReaction = userReaction.bind(this);
return boundUserReaction(...args);
}
Meteor.publish('user-reaction', publish);