This commit is contained in:
simplonco
2023-01-16 07:16:48 +01:00
parent 23d45db6ae
commit cc47a64b2a
4 changed files with 11 additions and 7 deletions

View File

@@ -471,7 +471,6 @@ export class ChatController {
let server = this.chatGateway.server;
await this.chatService.addMessageToRoom(room_name, "SERVER", message);
await server.in(socket.room).emit('message', "SERVER", message);
//await server.to(socket.id).emit('muted');
const room = await this.chatService.getRoomByName(room_name);
@@ -516,6 +515,12 @@ export class ChatController {
await this.chatService.removeMute(username, room_name);
let message = `${req.user.username} has un-muted ${username}`;
let socket: socketDto = this.chatGateway.sockets.get(req.user.username);
let server = this.chatGateway.server;
await this.chatService.addMessageToRoom(room_name, "SERVER", message);
await server.in(socket.room).emit('message', "SERVER", message);
res.status(HttpStatus.OK).json({ message: "successfull unmute" });
printCaller("- out ");
}

View File

@@ -7,7 +7,8 @@ export class muteDto
name: string;
@IsDate()
date: Date;
@IsOptional()
date?: Date;
}