From 5503d1af0bd25f74b1df151a83422e092bc4f61c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 2 Apr 2020 19:06:32 +0200 Subject: [PATCH] Update method --- src/controllers/UserWebSocketActions.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/controllers/UserWebSocketActions.ts b/src/controllers/UserWebSocketActions.ts index 344f6c6..d75d28f 100644 --- a/src/controllers/UserWebSocketActions.ts +++ b/src/controllers/UserWebSocketActions.ts @@ -178,13 +178,10 @@ export class UserWebSocketActions { * @param comment Deleted comment */ public static async DeletedComment(comment: 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 - })) - } + await UserWebSocketController.SendToSpecifcClients( + (e) => e.registeredPosts.has(comment.postID), + async () => WsMessage.NoIDMessage("comment_deleted", comment.id) + ) } }