Convert “new post reply found” into EventBus-based event.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / WebInterface.java
index 98b2f46..7432e5f 100644 (file)
@@ -37,6 +37,8 @@ import java.util.logging.Logger;
 
 import net.pterodactylus.sone.core.Core;
 import net.pterodactylus.sone.core.CoreListener;
+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.data.Album;
 import net.pterodactylus.sone.data.Image;
@@ -790,15 +792,12 @@ public class WebInterface implements CoreListener {
                }
        }
 
-       //
-       // CORELISTENER METHODS
-       //
-
        /**
         * {@inheritDoc}
         */
-       @Override
-       public void newPostFound(Post post) {
+       @Subscribe
+       public void newPostFound(NewPostFoundEvent newPostFoundEvent) {
+               Post post = newPostFoundEvent.post();
                boolean isLocal = post.getSone().isLocal();
                if (isLocal) {
                        localPostNotification.add(post);
@@ -819,8 +818,9 @@ public class WebInterface implements CoreListener {
        /**
         * {@inheritDoc}
         */
-       @Override
-       public void newReplyFound(PostReply reply) {
+       @Subscribe
+       public void newReplyFound(NewPostReplyFoundEvent newPostReplyFoundEvent) {
+               PostReply reply = newPostReplyFoundEvent.postReply();
                boolean isLocal = reply.getSone().isLocal();
                if (isLocal) {
                        localReplyNotification.add(reply);
@@ -838,6 +838,10 @@ public class WebInterface implements CoreListener {
                }
        }
 
+       //
+       // CORELISTENER METHODS
+       //
+
        /**
         * {@inheritDoc}
         */