280b32d21d
- Removed the connection-status history from the user list's gear icon and now is opened by the connection-status button. Moderators will render the same modal as before and viewers will only have access to their own data. - Added data-savings shortcut at the connection-status modal. - Added websocket round-trip time.
33 lines
741 B
JavaScript
33 lines
741 B
JavaScript
import ConnectionStatus from '/imports/api/connection-status';
|
|
import Logger from '/imports/startup/server/logger';
|
|
import { check } from 'meteor/check';
|
|
|
|
export default function updateConnectionStatus(meetingId, userId, level) {
|
|
check(meetingId, String);
|
|
check(userId, String);
|
|
|
|
const timestamp = new Date().getTime();
|
|
|
|
const selector = {
|
|
meetingId,
|
|
userId,
|
|
};
|
|
|
|
const modifier = {
|
|
meetingId,
|
|
userId,
|
|
level,
|
|
timestamp,
|
|
};
|
|
|
|
try {
|
|
const { numberAffected } = ConnectionStatus.upsert(selector, modifier);
|
|
|
|
if (numberAffected) {
|
|
Logger.verbose(`Updated connection status userId=${userId} level=${level}`);
|
|
}
|
|
} catch (err) {
|
|
Logger.error(`Updating connection status: ${err}`);
|
|
}
|
|
}
|