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

33 lines
752 B
JavaScript
Raw Normal View History

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,
};
};
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,
};