2017-05-04 04:12:47 +08:00
|
|
|
import muteToggle from '../methods/muteToggle';
|
2017-02-24 02:52:50 +08:00
|
|
|
|
|
|
|
import Users from '/imports/api/users';
|
|
|
|
|
|
|
|
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,
|
2017-06-03 03:25:02 +08:00
|
|
|
}, userId, true),
|
2017-02-24 02:52:50 +08:00
|
|
|
);
|
2017-06-03 03:25:02 +08:00
|
|
|
}
|