2016-09-22 02:03:18 +08:00
|
|
|
import Auth from '/imports/ui/services/auth/index.js';
|
|
|
|
import Users from '/imports/api/users';
|
|
|
|
import { callServer } from '/imports/ui/services/api/index.js';
|
|
|
|
|
|
|
|
let getEmojiData = () => {
|
|
|
|
|
|
|
|
// Get userId and meetingId
|
|
|
|
const credentials = Auth.getCredentials();
|
2016-09-27 04:29:44 +08:00
|
|
|
const { requesterUserId: userId, meetingId } = credentials;
|
2016-09-22 02:03:18 +08:00
|
|
|
|
|
|
|
// Find the Emoji Status of this specific meeting and userid
|
|
|
|
const userEmojiStatus = Users.findOne({
|
|
|
|
meetingId: meetingId,
|
|
|
|
userId: userId,
|
|
|
|
}).user.emoji_status;
|
|
|
|
|
|
|
|
return {
|
|
|
|
userEmojiStatus: userEmojiStatus,
|
|
|
|
credentials: credentials,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// Below doesn't even need to receieve credentials
|
|
|
|
const setEmoji = (toRaiseUserId, status) => {
|
|
|
|
callServer('userSetEmoji', toRaiseUserId, status);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
getEmojiData,
|
|
|
|
setEmoji,
|
|
|
|
};
|