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,
|
2016-06-01 04:25:42 +08:00
|
|
|
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
|
|
|
|
2016-06-01 04:25:42 +08:00
|
|
|
export default {
|
|
|
|
mapUsers
|
|
|
|
};
|