mute ok
This commit is contained in:
@@ -471,7 +471,6 @@ export class ChatController {
|
|||||||
let server = this.chatGateway.server;
|
let server = this.chatGateway.server;
|
||||||
await this.chatService.addMessageToRoom(room_name, "SERVER", message);
|
await this.chatService.addMessageToRoom(room_name, "SERVER", message);
|
||||||
await server.in(socket.room).emit('message', "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);
|
const room = await this.chatService.getRoomByName(room_name);
|
||||||
|
|
||||||
@@ -516,6 +515,12 @@ export class ChatController {
|
|||||||
|
|
||||||
await this.chatService.removeMute(username, room_name);
|
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" });
|
res.status(HttpStatus.OK).json({ message: "successfull unmute" });
|
||||||
printCaller("- out ");
|
printCaller("- out ");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ export class muteDto
|
|||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsDate()
|
@IsDate()
|
||||||
date: Date;
|
@IsOptional()
|
||||||
|
date?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,16 +14,14 @@
|
|||||||
let date_string: string;
|
let date_string: string;
|
||||||
get_is_mute($settings_user).then(response =>
|
get_is_mute($settings_user).then(response =>
|
||||||
{
|
{
|
||||||
if (response && response.date)
|
if (response && response.name)
|
||||||
{
|
|
||||||
is_mute = true;
|
is_mute = true;
|
||||||
|
if (response && response.date)
|
||||||
mute_date = response.date;
|
mute_date = response.date;
|
||||||
}
|
|
||||||
if (mute_date)
|
if (mute_date)
|
||||||
date_string = stringify_date(new Date(mute_date));
|
date_string = stringify_date(new Date(mute_date));
|
||||||
else
|
else
|
||||||
date_string = "eternity";
|
date_string = "eternity";
|
||||||
date_string = date_string;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let is_forever;
|
let is_forever;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function socket_events(socket)
|
|||||||
|
|
||||||
socket.on('new_password', function()
|
socket.on('new_password', function()
|
||||||
{
|
{
|
||||||
to_print("notification new password:");
|
to_print("notification new password");
|
||||||
layout.set("password");
|
layout.set("password");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user