X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=c7575998ac29258c55407e3f5b198503439dcda7;hp=ea357d215c7f9ca33375dd98b856d578a15e7dfa;hb=b5848fd116890f2b9434f169a16d203f24bfa94e;hpb=7a4ce0402bb7146ad791fbc52c0cf9b4d6871c91 diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index ea357d2..c757599 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -169,6 +169,7 @@ public class WebInterface implements SessionProvider { LinkedElementRenderFilter linkedElementRenderFilter, PageToadletRegistry pageToadletRegistry, MetricRegistry metricRegistry, Translation translation, L10nFilter l10nFilter, NotificationManager notificationManager, @Named("newRemotePost") ListNotification newPostNotification, + @Named("newRemotePostReply") ListNotification newReplyNotification, @Named("localPost") ListNotification localPostNotification) { this.sonePlugin = sonePlugin; this.loaders = loaders; @@ -187,6 +188,7 @@ public class WebInterface implements SessionProvider { this.translation = translation; this.notificationManager = notificationManager; this.newPostNotification = newPostNotification; + this.newReplyNotification = newReplyNotification; this.localPostNotification = localPostNotification; formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword(); @@ -195,9 +197,6 @@ public class WebInterface implements SessionProvider { templateContextFactory.addTemplateObject("formPassword", formPassword); /* create notifications. */ - Template newReplyNotificationTemplate = loaders.loadTemplate("/templates/notify/newReplyNotification.html"); - newReplyNotification = new ListNotification<>("new-reply-notification", "replies", newReplyNotificationTemplate, false); - Template localReplyNotificationTemplate = loaders.loadTemplate("/templates/notify/newReplyNotification.html"); localReplyNotification = new ListNotification<>("local-reply-notification", "replies", localReplyNotificationTemplate, false); } @@ -527,11 +526,9 @@ public class WebInterface implements SessionProvider { boolean isLocal = reply.getSone().isLocal(); if (isLocal) { localReplyNotification.add(reply); - } else { - newReplyNotification.add(reply); - } - if (!hasFirstStartNotification()) { - notificationManager.addNotification(isLocal ? localReplyNotification : newReplyNotification); + if (!hasFirstStartNotification()) { + notificationManager.addNotification(localReplyNotification); + } } } @@ -560,7 +557,6 @@ public class WebInterface implements SessionProvider { } private void removeReply(PostReply reply) { - newReplyNotification.remove(reply); localReplyNotification.remove(reply); }