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/app/lib/server/functions/deleteRoom.js

13 lines
488 B

import { Messages, Subscriptions, Rooms } from '../../../models';
import { callbacks } from '../../../callbacks';
import { FileUpload } from '../../../file-upload/server';
export const deleteRoom = function(rid) {
FileUpload.removeFilesByRoomId(rid);
Messages.removeByRoomId(rid);
callbacks.run('beforeDeleteRoom', rid);
Subscriptions.removeByRoomId(rid);
FileUpload.getStore('Avatars').deleteByRoomId(rid);
callbacks.run('afterDeleteRoom', rid);
return Rooms.removeById(rid);
};