bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/emoji-menu/service.js

31 lines
766 B
JavaScript
Raw Normal View History

import Auth from '/imports/ui/services/auth/index.js';
import Users from '/imports/api/users';
2017-04-26 21:47:44 +08:00
import { makeCall } from '/imports/ui/services/api/index.js';
2017-06-03 03:25:02 +08:00
const getEmojiData = () => {
// Get userId and meetingId
const credentials = Auth.credentials;
const { requesterUserId: userId, meetingId } = credentials;
// Find the Emoji Status of this specific meeting and userid
const userEmojiStatus = Users.findOne({
meetingId: Auth.meetingID,
userId: Auth.userID,
}).user.emoji_status;
return {
2017-06-03 03:25:02 +08:00
userEmojiStatus,
credentials,
};
};
// Below doesn't even need to receieve credentials
const setEmoji = (toRaiseUserId, status) => {
2017-04-26 21:47:44 +08:00
makeCall('setEmojiStatus', toRaiseUserId, status);
};
export default {
getEmojiData,
setEmoji,
};