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/apps/meteor/app/lib/server/functions/deleteRoom.ts

14 lines
565 B

import { Messages, Rooms, Subscriptions } from '@rocket.chat/models';
import { callbacks } from '../../../../lib/callbacks';
import { FileUpload } from '../../../file-upload/server';
export const deleteRoom = async function (rid: string): Promise<void> {
await FileUpload.removeFilesByRoomId(rid);
await Messages.removeByRoomId(rid);
await callbacks.run('beforeDeleteRoom', rid);
await Subscriptions.removeByRoomId(rid);
await FileUpload.getStore('Avatars').deleteByRoomId(rid);
await callbacks.run('afterDeleteRoom', rid);
await Rooms.removeById(rid);
};