From 73f97b626f967ea22944f07aa95d5c69ca671d39 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 2 Apr 2020 18:58:25 +0200 Subject: [PATCH] Update method --- src/controllers/UserWebSocketActions.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/controllers/UserWebSocketActions.ts b/src/controllers/UserWebSocketActions.ts index c26b6bd..2bf5621 100644 --- a/src/controllers/UserWebSocketActions.ts +++ b/src/controllers/UserWebSocketActions.ts @@ -138,16 +138,10 @@ export class UserWebSocketActions { public static async UpdatedConversationMessage(msgID: number) { const msg = await ConversationsHelper.GetSingleMessage(msgID); - for(const client of UserWebSocketController.active_clients.filter( - e => e.registeredConversations.has(msg.convID))) { - - UserWebSocketController.SendToClient(client, new WsMessage({ - id: "", - title: "updated_conv_message", - data: ConversationsController.ConversationMessageToAPI(msg) - })) - - } + await UserWebSocketController.SendToSpecifcClients( + (e) => e.registeredConversations.has(msg.convID), + () => WsMessage.NoIDMessage("updated_conv_message", ConversationsController.ConversationMessageToAPI(msg)) + ) } /**