X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=11708099860bf5a71a96bb8ef3af3dc988e3ceef;hb=2a83103aab6254d877c1b5214ca5a3ef19a6fe83;hp=b4c5942c684288997b522094ad329074405ef4ef;hpb=75f931afe328cddc83a80bd70e2c582566b80d80;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 b4c5942..1170809 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -203,7 +203,8 @@ public class WebInterface implements SessionProvider { RenderFilter renderFilter, LinkedElementRenderFilter linkedElementRenderFilter, PageToadletRegistry pageToadletRegistry, MetricRegistry metricRegistry, Translation translation, L10nFilter l10nFilter, - NotificationManager notificationManager, @Named("newRemotePost") ListNotification newPostNotification) { + NotificationManager notificationManager, @Named("newRemotePost") ListNotification newPostNotification, + @Named("localPost") ListNotification localPostNotification) { this.sonePlugin = sonePlugin; this.loaders = loaders; this.listNotificationFilter = listNotificationFilter; @@ -221,6 +222,7 @@ public class WebInterface implements SessionProvider { this.translation = translation; this.notificationManager = notificationManager; this.newPostNotification = newPostNotification; + this.localPostNotification = localPostNotification; formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword(); soneTextParser = new SoneTextParser(getCore(), getCore()); @@ -229,9 +231,6 @@ public class WebInterface implements SessionProvider { templateContextFactory.addTemplateObject("formPassword", formPassword); /* create notifications. */ - Template localPostNotificationTemplate = loaders.loadTemplate("/templates/notify/newPostNotification.html"); - localPostNotification = new ListNotification<>("local-post-notification", "posts", localPostNotificationTemplate, false); - Template newReplyNotificationTemplate = loaders.loadTemplate("/templates/notify/newReplyNotification.html"); newReplyNotification = new ListNotification<>("new-reply-notification", "replies", newReplyNotificationTemplate, false); @@ -676,13 +675,7 @@ public class WebInterface implements SessionProvider { public void newPostFound(NewPostFoundEvent newPostFoundEvent) { Post post = newPostFoundEvent.getPost(); boolean isLocal = post.getSone().isLocal(); - if (isLocal) { - localPostNotification.add(post); - } if (!hasFirstStartNotification()) { - if (isLocal) { - notificationManager.addNotification(localPostNotification); - } if (!getMentionedSones(post.getText()).isEmpty() && !isLocal) { mentionNotification.add(post); notificationManager.addNotification(mentionNotification); @@ -733,7 +726,6 @@ public class WebInterface implements SessionProvider { private void removePost(Post post) { newPostNotification.remove(post); - localPostNotification.remove(post); if (!localSoneMentionedInNewPostOrReply(post)) { mentionNotification.remove(post); }