bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/user-list/service.js

28 lines
667 B
JavaScript
Raw Normal View History

2016-05-20 02:22:56 +08:00
import Users from '/imports/api/users';
import LocalStorage from '/imports/ui/services/storage';
let mapUsers = function() {
let currentUserID = LocalStorage.get('userID');
let users = Users.find().map(u => {
return {
id: u.user.userid,
name: u.user.name,
isPresenter: u.user.presenter,
isModerator: u.user.role === "MODERATOR",
isCurrent: u.user.userid === currentUserID,
isVoiceUser: u.user.voiceUser.joined,
isMuted: u.user.voiceUser.muted,
2016-05-20 02:22:56 +08:00
isListenOnly: u.user.listenOnly,
2016-05-31 19:29:38 +08:00
isSharingWebcam: u.user.webcam_stream.length
2016-05-20 02:22:56 +08:00
};
2016-05-31 19:29:38 +08:00
});
2016-05-20 02:22:56 +08:00
return {
users: users
};
2016-05-31 19:29:38 +08:00
};
2016-05-20 02:22:56 +08:00
export default {
mapUsers
};