bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/methods/userSetEmoji.js

24 lines
778 B
JavaScript
Raw Normal View History

2016-05-05 02:29:43 +08:00
import { publish } from '/imports/startup/server/redispubsub';
import { isAllowedTo } from '/imports/startup/server/user_permissions';
import { appendMessageHeader } from '/imports/startup/server/helpers';
import { redisConfig } from '/config';
2016-04-20 01:43:31 +08:00
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,
2016-04-20 05:16:32 +08:00
}
2016-04-20 01:43:31 +08:00
};
2016-04-20 05:16:32 +08:00
message = appendMessageHeader('user_emoji_status_message', message);
2016-04-20 01:43:31 +08:00
// publish to pubsub
publish(redisConfig.channels.toBBBApps.users, message);
2016-04-20 01:43:31 +08:00
}
}
});