mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-24 02:13:28 +00:00
Create comment updated event
This commit is contained in:
@ -16,6 +16,7 @@ import { PostAccessLevel } from "../entities/Post";
|
||||
import { Comment } from "../entities/Comment";
|
||||
import { CommentsController } from "./CommentsController";
|
||||
import { AbritraryUserConnection } from "../entities/UserConnectionContainer";
|
||||
import { CommentsHelper } from "../helpers/CommentsHelper";
|
||||
|
||||
export class UserWebSocketActions {
|
||||
|
||||
@ -153,6 +154,17 @@ export class UserWebSocketActions {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Propagate comment update
|
||||
*
|
||||
* @param c New comment
|
||||
*/
|
||||
public static async UpdatedComment(commentID: number) {
|
||||
const comment = await CommentsHelper.GetSingle(commentID);
|
||||
|
||||
console.info(comment)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -165,5 +177,6 @@ EventsHelper.Listen("updated_number_unread_conversations", async (e) => await Us
|
||||
// When a new message is sent
|
||||
EventsHelper.Listen("sent_conversation_message", async (e) => await UserWebSocketActions.SentNewConversationMessage(e.msg));
|
||||
|
||||
// When a comment is created
|
||||
EventsHelper.Listen("comment_created", async (e) => await UserWebSocketActions.CreatedNewComment(e.comment))
|
||||
// When a comment is created / updated
|
||||
EventsHelper.Listen("comment_created", async (e) => await UserWebSocketActions.CreatedNewComment(e.comment))
|
||||
EventsHelper.Listen("comment_updated", async (e) => await UserWebSocketActions.UpdatedComment(e.commentID));
|
Reference in New Issue
Block a user