X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=027fb7f2283946ff6b4fc7b3334e42686693e5d3;hp=c7575998ac29258c55407e3f5b198503439dcda7;hb=79ef6e4644845290d9feb45a06f8588864dd0a83;hpb=c7a324e45e46ac629a5a3da5c3458bc66d18938f diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index c757599..027fb7f 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -170,7 +170,8 @@ public class WebInterface implements SessionProvider { PageToadletRegistry pageToadletRegistry, MetricRegistry metricRegistry, Translation translation, L10nFilter l10nFilter, NotificationManager notificationManager, @Named("newRemotePost") ListNotification newPostNotification, @Named("newRemotePostReply") ListNotification newReplyNotification, - @Named("localPost") ListNotification localPostNotification) { + @Named("localPost") ListNotification localPostNotification, + @Named("localReply") ListNotification localReplyNotification) { this.sonePlugin = sonePlugin; this.loaders = loaders; this.listNotificationFilter = listNotificationFilter; @@ -190,15 +191,12 @@ public class WebInterface implements SessionProvider { this.newPostNotification = newPostNotification; this.newReplyNotification = newReplyNotification; this.localPostNotification = localPostNotification; + this.localReplyNotification = localReplyNotification; formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword(); this.templateContextFactory = templateContextFactory; templateContextFactory.addTemplateObject("webInterface", this); templateContextFactory.addTemplateObject("formPassword", formPassword); - - /* create notifications. */ - Template localReplyNotificationTemplate = loaders.loadTemplate("/templates/notify/newReplyNotification.html"); - localReplyNotification = new ListNotification<>("local-reply-notification", "replies", localReplyNotificationTemplate, false); } // @@ -514,35 +512,12 @@ public class WebInterface implements SessionProvider { // EVENT HANDLERS // - /** - * Notifies the web interface that a new {@link PostReply} was found. - * - * @param newPostReplyFoundEvent - * The event - */ - @Subscribe - public void newReplyFound(NewPostReplyFoundEvent newPostReplyFoundEvent) { - PostReply reply = newPostReplyFoundEvent.getPostReply(); - boolean isLocal = reply.getSone().isLocal(); - if (isLocal) { - localReplyNotification.add(reply); - if (!hasFirstStartNotification()) { - notificationManager.addNotification(localReplyNotification); - } - } - } - @Subscribe public void markPostKnown(MarkPostKnownEvent markPostKnownEvent) { removePost(markPostKnownEvent.getPost()); } @Subscribe - public void markReplyKnown(MarkPostReplyKnownEvent markPostReplyKnownEvent) { - removeReply(markPostReplyKnownEvent.getPostReply()); - } - - @Subscribe public void postRemoved(PostRemovedEvent postRemovedEvent) { removePost(postRemovedEvent.getPost()); } @@ -551,15 +526,6 @@ public class WebInterface implements SessionProvider { newPostNotification.remove(post); } - @Subscribe - public void replyRemoved(PostReplyRemovedEvent postReplyRemovedEvent) { - removeReply(postReplyRemovedEvent.getPostReply()); - } - - private void removeReply(PostReply reply) { - localReplyNotification.remove(reply); - } - /** * Notifies the web interface that a {@link Sone} is being inserted. *