diff --git a/src/controllers/UserWebSocketActions.ts b/src/controllers/UserWebSocketActions.ts index 003e14c..344f6c6 100644 --- a/src/controllers/UserWebSocketActions.ts +++ b/src/controllers/UserWebSocketActions.ts @@ -165,13 +165,11 @@ export class UserWebSocketActions { public static async UpdatedComment(commentID: number) { const comment = await CommentsHelper.GetSingle(commentID); - for(const client of UserWebSocketController.active_clients.filter((e) => e.registeredPosts.has(comment.postID))) { - UserWebSocketController.SendToClient(client, new WsMessage({ - id: "", - title: "comment_updated", - data: await CommentsController.CommentToAPI(new AbritraryUserConnection(client.userID), comment) - })) - } + await UserWebSocketController.SendToSpecifcClients( + (e) => e.registeredPosts.has(comment.postID), + async (client) => WsMessage.NoIDMessage("comment_updated", + await CommentsController.CommentToAPI(new AbritraryUserConnection(client.userID), comment)) + ) } /**