1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-24 22:39:21 +00:00

Update method

This commit is contained in:
Pierre HUBERT 2020-04-02 19:00:56 +02:00
parent 73f97b626f
commit 5d9067d3a7

View File

@ -150,16 +150,11 @@ export class UserWebSocketActions {
* @param c New comment
*/
public static async CreatedNewComment(c: Comment) {
for(const client of UserWebSocketController.active_clients.filter((e) => e.registeredPosts.has(c.postID))) {
UserWebSocketController.SendToClient(client, new WsMessage({
id: "",
title: "new_comment",
data: await CommentsController.CommentToAPI(new AbritraryUserConnection(client.userID), c, true)
}))
}
await UserWebSocketController.SendToSpecifcClients(
(e) => e.registeredPosts.has(c.postID),
async (client) => WsMessage.NoIDMessage("new_comment",
await CommentsController.CommentToAPI(new AbritraryUserConnection(client.userID), c, true))
)
}
/**