2016-06-02 01:18:13 +08:00
|
|
|
import { publish } from '/imports/api/common/server/helpers';
|
2016-05-05 04:25:34 +08:00
|
|
|
import { isAllowedTo } from '/imports/startup/server/userPermissions';
|
2016-06-02 01:18:13 +08:00
|
|
|
import { appendMessageHeader } from '/imports/api/common/server/helpers';
|
2016-04-29 06:01:43 +08:00
|
|
|
import { redisConfig } from '/config';
|
2016-04-28 05:04:15 +08:00
|
|
|
|
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
|
2016-04-29 06:01:43 +08:00
|
|
|
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
|
|
|
});
|