bigbluebutton-Github/bigbluebutton-html5/server/methods/userSetEmoji.js
2016-04-27 21:04:15 +00:00

23 lines
699 B
JavaScript

import { publish } from '/server/redispubsub';
import { isAllowedTo } from '/server/user_permissions';
import { appendMessageHeader } from '/server/helpers';
Meteor.methods({
userSetEmoji(meetingId, toRaiseUserId, raisedByUserId, raisedByToken, status) {
let message;
if (isAllowedTo('setEmojiStatus', meetingId, raisedByUserId, raisedByToken)) {
message = {
payload: {
emoji_status: status,
userid: toRaiseUserId,
meeting_id: meetingId,
}
};
message = appendMessageHeader('user_emoji_status_message', message);
// publish to pubsub
publish(Meteor.config.redis.channels.toBBBApps.users, message);
}
}
});