feat: log roomId/roomName on delete

isekai-main
Barış Soner Uşaklı 1 year ago
parent 2804b5ac9a
commit b958a39a66

@ -34,10 +34,16 @@ Admin.getAnalyticsData = async (req, res) => {
Admin.chats = {};
Admin.chats.deleteRoom = async (req, res) => {
const roomData = await messaging.getRoomData(req.params.roomId);
if (!roomData) {
throw new Error('[[error:no-room]]');
}
await messaging.deleteRooms([req.params.roomId]);
events.log({
type: 'chat-room-deleted',
roomId: req.params.roomId,
roomName: roomData.roomName ? roomData.roomName : `No room name`,
uid: req.uid,
ip: req.ip,
});

Loading…
Cancel
Save