bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/methods/userSetEmoji.js

26 lines
796 B
JavaScript
Raw Normal View History

2016-06-02 01:18:13 +08:00
import { publish } from '/imports/api/common/server/helpers';
import { isAllowedTo } from '/imports/startup/server/userPermissions';
2016-06-02 01:18:13 +08:00
import { appendMessageHeader } from '/imports/api/common/server/helpers';
import { redisConfig } from '/config';
2016-04-20 01:43:31 +08:00
Meteor.methods({
2016-05-17 02:12:27 +08:00
userSetEmoji(credentials, toRaiseUserId, status) {
const { meetingId, requesterUserId, requesterToken } = credentials;
2016-04-20 01:43:31 +08:00
let message;
2016-05-17 02:12:27 +08:00
if (isAllowedTo('setEmojiStatus', credentials)) {
2016-04-20 01:43:31 +08:00
message = {
payload: {
emoji_status: status,
userid: toRaiseUserId,
meeting_id: meetingId,
2016-05-05 05:49:01 +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-05-05 05:49:01 +08:00
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
}
2016-05-05 05:49:01 +08:00
},
2016-04-20 01:43:31 +08:00
});