1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Notify of comment update

This commit is contained in:
Pierre HUBERT 2020-04-02 10:57:38 +02:00
parent b636f9c14e
commit 25f25815f5

View File

@ -163,7 +163,13 @@ export class UserWebSocketActions {
public static async UpdatedComment(commentID: number) {
const comment = await CommentsHelper.GetSingle(commentID);
console.info(comment)
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, true)
}))
}
}
}