bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/presentation-overlay/service.js
2017-04-19 12:13:52 -07:00

34 lines
828 B
JavaScript
Executable File

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,
};
};
const updateCursor = (coordinates) => {
callServer('publishCursorUpdate', coordinates);
};
export default {
updateCursor,
getUserData,
};