mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-25 06:49:23 +00:00
Update method
This commit is contained in:
parent
73f97b626f
commit
5d9067d3a7
@ -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))
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user