bigbluebutton-Github/bigbluebutton-html5/imports/api/users-persistent-data/server/modifiers/setOnlineStatus.js

27 lines
584 B
JavaScript
Raw Normal View History

2021-03-20 04:12:27 +08:00
import { check } from 'meteor/check';
import UsersPersistentData from '/imports/api/users-persistent-data';
import Logger from '/imports/startup/server/logger';
export default function setOnlineStatus(userId, meetingId, status = false) {
check(userId, String);
check(meetingId, String);
check(status, Boolean);
const selector = {
userId,
meetingId,
};
const modifier = {
$set: {
online: status,
},
};
try {
UsersPersistentData.update(selector, modifier);
} catch (err) {
Logger.error(`Adding note to the collection: ${err}`);
}
}