The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/startup/presence.js

20 lines
605 B

import { Meteor } from 'meteor/meteor';
import { UserPresence } from 'meteor/konecty:user-presence';
import { InstanceStatus, UsersSessions } from '../../app/models/server/raw';
import { isPresenceMonitorEnabled } from '../lib/isPresenceMonitorEnabled';
Meteor.startup(function() {
UserPresence.start();
if (!isPresenceMonitorEnabled()) {
return;
}
// UserPresenceMonitor.start();
// Remove lost connections
const ids = Promise.await(InstanceStatus.find({}, { projection: { _id: 1 } }).toArray())
.map((id) => id._id);
Promise.await(UsersSessions.clearConnectionsFromInstanceId(ids));
});