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;
}

View File

@@ -14,16 +14,14 @@
let date_string: string;
get_is_mute($settings_user).then(response =>
{
if (response && response.date)
{
if (response && response.name)
is_mute = true;
if (response && response.date)
mute_date = response.date;
}
if (mute_date)
date_string = stringify_date(new Date(mute_date));
else
date_string = "eternity";
date_string = date_string;
});
let is_forever;

View File

@@ -37,7 +37,7 @@ function socket_events(socket)
socket.on('new_password', function()
{
to_print("notification new password:");
to_print("notification new password");
layout.set("password");
});
}