use of org.moera.node.model.event.PostingCommentsChangedEvent in project moera-node by MoeraOrg.
the class CommentReceptor method added.
@LiberinMapping
public void added(CommentAddedLiberin liberin) {
Comment comment = liberin.getComment();
Posting posting = liberin.getPosting();
if (comment.getCurrentRevision().getSignature() != null) {
UUID repliedToId = comment.getRepliedTo() != null ? comment.getRepliedTo().getId() : null;
send(Directions.postingCommentsSubscribers(posting.getNodeId(), posting.getId()), new PostingCommentAddedNotification(posting.getId(), posting.getCurrentRevision().getHeading(), comment.getId(), comment.getOwnerName(), comment.getOwnerFullName(), new AvatarImage(comment.getOwnerAvatarMediaFile(), comment.getOwnerAvatarShape()), comment.getCurrentRevision().getHeading(), repliedToId));
}
notifyReplyAdded(posting, comment);
notifyMentioned(posting, comment.getId(), comment.getOwnerName(), comment.getOwnerFullName(), new AvatarImage(comment.getOwnerAvatarMediaFile(), comment.getOwnerAvatarShape()), comment.getCurrentRevision(), null);
send(liberin, new CommentAddedEvent(comment));
send(liberin, new PostingCommentsChangedEvent(posting));
send(Directions.postingSubscribers(posting.getNodeId(), posting.getId()), new PostingCommentsUpdatedNotification(posting.getId(), posting.getTotalChildren()));
}
use of org.moera.node.model.event.PostingCommentsChangedEvent in project moera-node by MoeraOrg.
the class PostingReceptor method commentTotalsUpdated.
@LiberinMapping
public void commentTotalsUpdated(PostingCommentTotalsUpdatedLiberin liberin) {
Posting posting = liberin.getPosting();
send(liberin, new PostingCommentsChangedEvent(posting));
send(Directions.postingSubscribers(posting.getNodeId(), posting.getId()), new PostingCommentsUpdatedNotification(posting.getId(), liberin.getTotal()));
}
use of org.moera.node.model.event.PostingCommentsChangedEvent 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));
}
Aggregations