use of org.moera.node.liberin.LiberinMapping 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.liberin.LiberinMapping in project moera-node by MoeraOrg.
the class PostingReceptor method added.
@LiberinMapping
public void added(PostingAddedLiberin liberin) {
Posting posting = liberin.getPosting();
if (posting.isOriginal()) {
notifyMentioned(liberin, posting.getId(), posting.getCurrentRevision(), null, posting.getOwnerName());
}
send(liberin, new PostingAddedEvent(posting));
if (liberin.getFeeds() != null) {
liberin.getFeeds().forEach(fn -> send(Directions.feedSubscribers(liberin.getNodeId(), fn), new FeedPostingAddedNotification(fn, posting.getId())));
}
}
use of org.moera.node.liberin.LiberinMapping in project moera-node by MoeraOrg.
the class ProfileReceptor method updated.
@LiberinMapping
public void updated(ProfileUpdatedLiberin liberin) {
send(liberin, new ProfileUpdatedEvent());
send(liberin, new NodeNameChangedEvent(liberin.getNodeName(), liberin.getOptions(), liberin.getAvatar()));
send(Directions.profileSubscribers(liberin.getNodeId()), new ProfileUpdatedNotification());
if (!Objects.equals(liberin.getOptions().getString("profile.email"), liberin.getOldEmail())) {
send(liberin, new EmailConfirmMail());
}
}
use of org.moera.node.liberin.LiberinMapping in project moera-node by MoeraOrg.
the class SubscriberReceptor method added.
@LiberinMapping
public void added(SubscriberAddedLiberin liberin) {
Subscriber subscriber = liberin.getSubscriber();
if (subscriber.getSubscriptionType() == SubscriptionType.POSTING && subscriber.getEntry() != null && !Util.toEpochSecond(subscriber.getEntry().getEditedAt()).equals(liberin.getSubscriberLastUpdatedAt())) {
PostingUpdatedNotification notification = new PostingUpdatedNotification(subscriber.getEntry().getId());
notification.setSubscriberId(subscriber.getId().toString());
notification.setSubscriptionCreatedAt(Util.now());
send(Directions.single(liberin.getNodeId(), subscriber.getRemoteNodeName()), notification);
}
send(liberin, new SubscriberAddedEvent(subscriber));
sendPeopleChangedEvent(liberin);
}
use of org.moera.node.liberin.LiberinMapping in project moera-node by MoeraOrg.
the class SubscriptionReceptor method deleted.
@LiberinMapping
public void deleted(SubscriptionDeletedLiberin liberin) {
send(liberin, new SubscriptionDeletedEvent(liberin.getSubscription()));
sendPeopleChangedEvent(liberin);
}
Aggregations