bigbluebutton-Github/bigbluebutton-html5/imports/api/1.1/users/server/modifiers/lockAllViewersMic.js
Oleksandr Zhurbenko 251bd22738 PR review fixes
2017-09-06 12:36:52 -07:00

24 lines
511 B
JavaScript

import muteToggle from '../methods/muteToggle';
import Users from './../../';
export default function lockAllViewersMic(meetingId) {
const selector = {
meetingId,
'user.role': 'VIEWER',
'user.listenOnly': false,
'user.locked': true,
'user.voiceUser.joined': true,
'user.voiceUser.muted': false,
};
const usersToMute = Users.find(selector).fetch();
usersToMute.forEach(user =>
muteToggle({
meetingId,
requesterUserId: user.userId,
}, userId, true),
);
}