bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/modifiers/handleLockingMic.js
Anton Georgiev 8d52dc1b40 Merge branch 'join-components-with-skeleton' of github.com:perroned/bigbluebutton into router-merging
Conflicts:
	bigbluebutton-html5/imports/api/chat/server/methods/sendChatMessagetoServer.js
	bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeetingToCollection.js
	bigbluebutton-html5/imports/api/polls/server/methods/publishVoteMessage.js
	bigbluebutton-html5/imports/api/slides/server/modifiers/clearSlidesCollection.js
	bigbluebutton-html5/imports/api/users/server/methods/muteUser.js
	bigbluebutton-html5/imports/api/users/server/methods/setUserPresenter.js
	bigbluebutton-html5/imports/api/users/server/methods/unmuteUser.js
	bigbluebutton-html5/imports/api/users/server/methods/userSetEmoji.js
	bigbluebutton-html5/imports/api/users/server/methods/validateAuthToken.js
	bigbluebutton-html5/imports/startup/server/eventHandlers.js
	bigbluebutton-html5/imports/ui/components/app/AppService.js
2016-05-16 19:54:51 +00:00

27 lines
861 B
JavaScript
Executable File

import Users from '/imports/api/users';
// when new lock settings including disableMic are set,
// all viewers that are in the audio bridge with a mic should be muted and locked
export function handleLockingMic(meetingId, newSettings) {
// send mute requests for the viewer users joined with mic
let i, results, userObject;
userObjects = Users.find({
meetingId: meetingId,
'user.role': 'VIEWER',
'user.listenOnly': false,
'user.locked': true,
'user.voiceUser.joined': true,
'user.voiceUser.muted': false,
}).fetch();
_userObjects_length = userObjects.length;
results = [];
for (i = 0; i < _userObjects_length; i++) {
userObject = userObjects[i];
results.push(Meteor.call('muteUser', meetingId, userObject.userId, userObject.userId,
userObject.authToken, true)); //true for muted
}
return results;
};