bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/presentation-overlay/service.js
2017-02-23 16:11:27 -08:00

34 lines
830 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 = (testArgument) => {
callServer('publishCursorUpdate', testArgument);
};
export default {
updateCursor,
getUserData,
};