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