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/ee/server/services/presence/actions/removeConnection.ts

23 lines
452 B

import { getCollection, Collections } from '../../mongo';
export async function removeConnection(uid: string, session: string): Promise<{ uid: string; session: string }> {
const query = {
'connections.id': session,
};
const update = {
$pull: {
connections: {
id: session,
},
},
};
const UserSession = await getCollection(Collections.UserSession);
await UserSession.updateMany(query, update);
return {
uid,
session,
};
}