bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/modifiers/createDummyUser.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

25 lines
812 B
JavaScript
Executable File

import Users from '/imports/api/users';
import { logger } from '/imports/startup/server/logger';
export function createDummyUser(meetingId, userId, authToken) {
if (Users.findOne({
userId: userId,
meetingId: meetingId,
authToken: authToken,
}) != null) {
const msg = `html5 user userId:[${userId}] from [${meetingId}] tried to revalidate token`;
return logger.info(msg);
} else {
return Users.insert({
meetingId: meetingId,
userId: userId,
authToken: authToken,
clientType: 'HTML5',
validated: false, //will be validated on validate_auth_token_reply
}, (err, id) => {
const res = Users.find({ meetingId: meetingId, }).count();
return logger.info(`_added a dummy html5 user userId=[${userId}] Users.size is now ${res}`);
});
}
};