bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/presentation-overlay/service.js

34 lines
828 B
JavaScript
Raw Normal View History

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,
};
};
const updateCursor = (coordinates) => {
callServer('publishCursorUpdate', coordinates);
2017-02-07 08:10:50 +08:00
};
export default {
updateCursor,
getUserData,
};