X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=7432e5f4d96c58c4bbf076313c07a1ac2e6fd5f3;hp=188cc7f1258d6a3f9faf2e5ecb69fa906244eb53;hb=227e3e5aa520354a7744844f9345bf20920519e7;hpb=1b525dcdbd58c5d73dd865e0f1b2b8cc6ddcc4eb diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 188cc7f..7432e5f 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -37,6 +37,9 @@ 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; import net.pterodactylus.sone.data.Post; @@ -132,6 +135,7 @@ import net.pterodactylus.util.web.TemplatePage; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableSet; +import com.google.common.eventbus.Subscribe; import com.google.inject.Inject; import freenet.clients.http.SessionManager; @@ -774,15 +778,15 @@ public class WebInterface implements CoreListener { } // - // CORELISTENER METHODS + // EVENT HANDLERS // /** * {@inheritDoc} */ - @Override - public void newSoneFound(Sone sone) { - newSoneNotification.add(sone); + @Subscribe + public void newSoneFound(NewSoneFoundEvent newSoneFoundEvent) { + newSoneNotification.add(newSoneFoundEvent.sone()); if (!hasFirstStartNotification()) { notificationManager.addNotification(newSoneNotification); } @@ -791,8 +795,9 @@ public class WebInterface implements CoreListener { /** * {@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); @@ -813,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); @@ -832,6 +838,10 @@ public class WebInterface implements CoreListener { } } + // + // CORELISTENER METHODS + // + /** * {@inheritDoc} */