2017-06-08 04:45:49 +08:00
|
|
|
import { makeCall } from '/imports/ui/services/api';
|
|
|
|
import Auth from '/imports/ui/services/auth/index.js';
|
2017-02-07 08:10:50 +08:00
|
|
|
import Users from '/imports/api/users';
|
|
|
|
|
|
|
|
let getUserData = () => {
|
|
|
|
// Get userId and meetingId
|
2017-06-08 04:45:49 +08:00
|
|
|
const credentials = Auth.credentials;
|
2017-02-07 08:10:50 +08:00
|
|
|
|
|
|
|
// Find the user object of this specific meeting and userid
|
|
|
|
const currentUser = Users.findOne({
|
2017-06-08 04:45:49 +08:00
|
|
|
meetingId: credentials.meetingId,
|
|
|
|
userId: credentials.requesterUserId,
|
2017-02-07 08:10:50 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
let isUserPresenter;
|
|
|
|
if (currentUser && currentUser.user) {
|
|
|
|
isUserPresenter = currentUser.user.presenter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
isUserPresenter: isUserPresenter,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2017-04-20 03:13:52 +08:00
|
|
|
const updateCursor = (coordinates) => {
|
2017-06-08 04:45:49 +08:00
|
|
|
makeCall('publishCursorUpdate', coordinates);
|
2017-02-07 08:10:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
updateCursor,
|
|
|
|
getUserData,
|
|
|
|
};
|