X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=4534c35b2b73d19f66bf6c7c5e5a5c9616a0086e;hb=fdcd6fa4e0110028080d0b4a9ef3c5f8e5a5e867;hp=74f90870954ebe7578bbed2c4b258091f139c542;hpb=5bec5f7d5b4fcbf25ff7fcc5636603611a9cc47f;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 74f9087..4534c35 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -38,10 +38,14 @@ import java.util.logging.Logger; import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.core.CoreListener; import net.pterodactylus.sone.core.event.MarkPostKnownEvent; +import net.pterodactylus.sone.core.event.MarkPostReplyKnownEvent; import net.pterodactylus.sone.core.event.MarkSoneKnownEvent; import net.pterodactylus.sone.core.event.NewPostFoundEvent; import net.pterodactylus.sone.core.event.NewPostReplyFoundEvent; import net.pterodactylus.sone.core.event.NewSoneFoundEvent; +import net.pterodactylus.sone.core.event.PostRemovedEvent; +import net.pterodactylus.sone.core.event.PostReplyRemovedEvent; +import net.pterodactylus.sone.core.event.SoneRemovedEvent; import net.pterodactylus.sone.data.Album; import net.pterodactylus.sone.data.Image; import net.pterodactylus.sone.data.Post; @@ -784,7 +788,10 @@ public class WebInterface implements CoreListener { // /** - * {@inheritDoc} + * Notifies the web interface that a new {@link Sone} was found. + * + * @param newSoneFoundEvent + * The event */ @Subscribe public void newSoneFound(NewSoneFoundEvent newSoneFoundEvent) { @@ -795,7 +802,10 @@ public class WebInterface implements CoreListener { } /** - * {@inheritDoc} + * Notifies the web interface that a new {@link Post} was found. + * + * @param newPostFoundEvent + * The event */ @Subscribe public void newPostFound(NewPostFoundEvent newPostFoundEvent) { @@ -818,7 +828,10 @@ public class WebInterface implements CoreListener { } /** - * {@inheritDoc} + * Notifies the web interface that a new {@link PostReply} was found. + * + * @param newPostReplyFoundEvent + * The event */ @Subscribe public void newReplyFound(NewPostReplyFoundEvent newPostReplyFoundEvent) { @@ -841,7 +854,10 @@ public class WebInterface implements CoreListener { } /** - * {@inheritDoc} + * Notifies the web interface that a {@link Sone} was marked as known. + * + * @param markSoneKnownEvent + * The event */ @Subscribe public void markSoneKnown(MarkSoneKnownEvent markSoneKnownEvent) { @@ -849,7 +865,10 @@ public class WebInterface implements CoreListener { } /** - * {@inheritDoc} + * Notifies the web interface that a {@link Post} was marked as known. + * + * @param markPostKnownEvent + * The event */ @Subscribe public void markPostKnown(MarkPostKnownEvent markPostKnownEvent) { @@ -858,43 +877,52 @@ public class WebInterface implements CoreListener { mentionNotification.remove(markPostKnownEvent.post()); } - // - // CORELISTENER METHODS - // - /** - * {@inheritDoc} + * Notifies the web interface that a {@link PostReply} was marked as known. + * + * @param markPostReplyKnownEvent + * The event */ - @Override - public void markReplyKnown(PostReply reply) { - newReplyNotification.remove(reply); - localReplyNotification.remove(reply); - mentionNotification.remove(reply.getPost()); + @Subscribe + public void markReplyKnown(MarkPostReplyKnownEvent markPostReplyKnownEvent) { + newReplyNotification.remove(markPostReplyKnownEvent.postReply()); + localReplyNotification.remove(markPostReplyKnownEvent.postReply()); + mentionNotification.remove(markPostReplyKnownEvent.postReply().getPost()); } /** - * {@inheritDoc} + * Notifies the web interface that a {@link Sone} was removed. + * + * @param soneRemovedEvent + * The event */ - @Override - public void soneRemoved(Sone sone) { - newSoneNotification.remove(sone); + @Subscribe + public void soneRemoved(SoneRemovedEvent soneRemovedEvent) { + newSoneNotification.remove(soneRemovedEvent.sone()); } /** - * {@inheritDoc} + * Notifies the web interface that a {@link Post} was removed. + * + * @param postRemovedEvent + * The event */ - @Override - public void postRemoved(Post post) { - newPostNotification.remove(post); - localPostNotification.remove(post); - mentionNotification.remove(post); + @Subscribe + public void postRemoved(PostRemovedEvent postRemovedEvent) { + newPostNotification.remove(postRemovedEvent.post()); + localPostNotification.remove(postRemovedEvent.post()); + mentionNotification.remove(postRemovedEvent.post()); } /** - * {@inheritDoc} + * Notifies the web interface that a {@link PostReply} was removed. + * + * @param postReplyRemovedEvent + * The event */ - @Override - public void replyRemoved(PostReply reply) { + @Subscribe + public void replyRemoved(PostReplyRemovedEvent postReplyRemovedEvent) { + PostReply reply = postReplyRemovedEvent.postReply(); newReplyNotification.remove(reply); localReplyNotification.remove(reply); if (!getMentionedSones(reply.getText()).isEmpty()) { @@ -908,6 +936,10 @@ public class WebInterface implements CoreListener { } } + // + // CORELISTENER METHODS + // + /** * {@inheritDoc} */