bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/logout-confirmation/service.js

28 lines
768 B
JavaScript
Raw Normal View History

2017-09-22 02:50:21 +08:00
import { makeCall } from '/imports/ui/services/api/index';
2017-09-02 03:37:14 +08:00
import Users from '/imports/api/2.0/users';
2017-09-22 02:50:21 +08:00
import Breakouts from '/imports/api/2.0/breakouts';
2017-09-02 04:00:55 +08:00
import mapUser from '/imports/ui/services/user/mapUser';
2017-09-02 03:37:14 +08:00
import Auth from '/imports/ui/services/auth';
const endMeeting = () => {
makeCall('endMeeting', Auth.credentials);
};
const isModerator = () => {
const currentUserId = Auth.userID;
const currentUser = Users.findOne({ userId: currentUserId });
2017-09-02 04:00:55 +08:00
return (currentUser) ? mapUser(currentUser).isModerator : null;
2017-09-02 03:37:14 +08:00
};
2017-09-22 02:50:21 +08:00
const isBreakout = () => {
console.log('isBreakout', Breakouts.findOne({ breakoutId: Auth.meetingID }));
return Breakouts.findOne({ breakoutId: Auth.meetingID });
};
2017-09-02 03:37:14 +08:00
export default {
endMeeting,
isModerator,
2017-09-22 02:50:21 +08:00
isBreakout,
2017-09-02 03:37:14 +08:00
};