From 618e2c143f1d9f8e0f7ea6248d3f9fbe4dfbd0f0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 2 Apr 2020 18:27:37 +0200 Subject: [PATCH] Send delete comment notification to client --- src/controllers/UserWebSocketActions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/UserWebSocketActions.ts b/src/controllers/UserWebSocketActions.ts index d4711b9..6ccb8ff 100644 --- a/src/controllers/UserWebSocketActions.ts +++ b/src/controllers/UserWebSocketActions.ts @@ -178,7 +178,13 @@ export class UserWebSocketActions { * @param comment Deleted comment */ public static async DeletedComment(comment: Comment) { - console.log(comment); + for(const client of UserWebSocketController.active_clients.filter((e) => e.registeredPosts.has(comment.postID))) { + UserWebSocketController.SendToClient(client, new WsMessage({ + id: "", + title: "comment_deleted", + data: comment.id + })) + } } }