bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/service.js

31 lines
702 B
JavaScript
Raw Normal View History

import Auth from '/imports/ui/services/auth';
import Users from '/imports/api/users';
import { makeCall } from '/imports/ui/services/api';
import VoiceUsers from '/imports/api/voice-users';
2017-06-03 03:25:02 +08:00
const isUserPresenter = () => Users.findOne({
2017-04-29 00:15:29 +08:00
userId: Auth.userID,
2017-07-26 22:09:07 +08:00
}).presenter;
2017-03-17 07:30:46 +08:00
const toggleSelfVoice = () => makeCall('toggleSelfVoice');
const getVoiceUserData = () => {
const userId = Auth.userID;
const voiceUser = VoiceUsers.findOne({ intId: userId });
const { muted, joined, talking, listenOnly } = voiceUser;
return ({
isInAudio: joined,
isMuted: muted,
isTalking: talking,
listenOnly,
});
};
export default {
isUserPresenter,
toggleSelfVoice,
getVoiceUserData,
};