Search in sources :

Example 1 with CommentDeletedEvent

use of org.moera.node.model.event.CommentDeletedEvent in project moera-node by MoeraOrg.

the class CommentReceptor method deleted.

@LiberinMapping
public void deleted(CommentDeletedLiberin liberin) {
    Comment comment = liberin.getComment();
    Posting posting = comment.getPosting();
    notifyReplyDeleted(posting, comment);
    notifyMentioned(posting, comment.getId(), comment.getOwnerName(), comment.getOwnerFullName(), new AvatarImage(comment.getOwnerAvatarMediaFile(), comment.getOwnerAvatarShape()), null, liberin.getLatestRevision());
    send(Directions.postingSubscribers(comment.getNodeId(), posting.getId()), new PostingCommentsUpdatedNotification(posting.getId(), posting.getTotalChildren()));
    send(Directions.postingCommentsSubscribers(comment.getNodeId(), posting.getId()), new PostingCommentDeletedNotification(posting.getId(), comment.getId(), comment.getOwnerName(), comment.getOwnerFullName(), new AvatarImage(comment.getOwnerAvatarMediaFile(), comment.getOwnerAvatarShape())));
    send(liberin, new CommentDeletedEvent(comment));
    send(liberin, new PostingCommentsChangedEvent(posting));
}
Also used : Comment(org.moera.node.data.Comment) Posting(org.moera.node.data.Posting) PostingCommentsChangedEvent(org.moera.node.model.event.PostingCommentsChangedEvent) PostingCommentDeletedNotification(org.moera.node.model.notification.PostingCommentDeletedNotification) AvatarImage(org.moera.node.model.AvatarImage) PostingCommentsUpdatedNotification(org.moera.node.model.notification.PostingCommentsUpdatedNotification) CommentDeletedEvent(org.moera.node.model.event.CommentDeletedEvent) LiberinMapping(org.moera.node.liberin.LiberinMapping)

Aggregations

Comment (org.moera.node.data.Comment)1 Posting (org.moera.node.data.Posting)1 LiberinMapping (org.moera.node.liberin.LiberinMapping)1 AvatarImage (org.moera.node.model.AvatarImage)1 CommentDeletedEvent (org.moera.node.model.event.CommentDeletedEvent)1 PostingCommentsChangedEvent (org.moera.node.model.event.PostingCommentsChangedEvent)1 PostingCommentDeletedNotification (org.moera.node.model.notification.PostingCommentDeletedNotification)1 PostingCommentsUpdatedNotification (org.moera.node.model.notification.PostingCommentsUpdatedNotification)1