X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=4ed49df3184f83a1ddb83ab02999703fc5bf1e4d;hb=0dc7811a459455dd2b670eb1924df27f65c36a24;hp=bcc7a115741d045ab8e378e74300591e2ad18283;hpb=174865a5a746755a0c09f51a7840ac0e6034cbb6;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 bcc7a11..4ed49df 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -157,9 +157,6 @@ public class WebInterface implements SessionProvider { private final MetricRegistry metricRegistry; private final Translation translation; - /** The “new Sone” notification. */ - private final ListNotification newSoneNotification; - /** The “new post” notification. */ private final ListNotification newPostNotification; @@ -233,9 +230,6 @@ public class WebInterface implements SessionProvider { templateContextFactory.addTemplateObject("formPassword", formPassword); /* create notifications. */ - Template newSoneNotificationTemplate = loaders.loadTemplate("/templates/notify/newSoneNotification.html"); - newSoneNotification = new ListNotification<>("new-sone-notification", "sones", newSoneNotificationTemplate, false); - Template newPostNotificationTemplate = loaders.loadTemplate("/templates/notify/newPostNotification.html"); newPostNotification = new ListNotification<>("new-post-notification", "posts", newPostNotificationTemplate, false); @@ -690,20 +684,6 @@ public class WebInterface implements SessionProvider { // /** - * Notifies the web interface that a new {@link Sone} was found. - * - * @param newSoneFoundEvent - * The event - */ - @Subscribe - public void newSoneFound(NewSoneFoundEvent newSoneFoundEvent) { - newSoneNotification.add(newSoneFoundEvent.getSone()); - if (!hasFirstStartNotification()) { - notificationManager.addNotification(newSoneNotification); - } - } - - /** * Notifies the web interface that a new {@link Post} was found. * * @param newPostFoundEvent @@ -715,17 +695,15 @@ public class WebInterface implements SessionProvider { boolean isLocal = post.getSone().isLocal(); if (isLocal) { localPostNotification.add(post); - } else { - newPostNotification.add(post); } if (!hasFirstStartNotification()) { - notificationManager.addNotification(isLocal ? localPostNotification : newPostNotification); + if (isLocal) { + notificationManager.addNotification(localPostNotification); + } if (!getMentionedSones(post.getText()).isEmpty() && !isLocal) { mentionNotification.add(post); notificationManager.addNotification(mentionNotification); } - } else { - getCore().markPostKnown(post); } } @@ -755,17 +733,6 @@ public class WebInterface implements SessionProvider { } } - /** - * Notifies the web interface that a {@link Sone} was marked as known. - * - * @param markSoneKnownEvent - * The event - */ - @Subscribe - public void markSoneKnown(MarkSoneKnownEvent markSoneKnownEvent) { - newSoneNotification.remove(markSoneKnownEvent.getSone()); - } - @Subscribe public void markPostKnown(MarkPostKnownEvent markPostKnownEvent) { removePost(markPostKnownEvent.getPost()); @@ -777,11 +744,6 @@ public class WebInterface implements SessionProvider { } @Subscribe - public void soneRemoved(SoneRemovedEvent soneRemovedEvent) { - newSoneNotification.remove(soneRemovedEvent.getSone()); - } - - @Subscribe public void postRemoved(PostRemovedEvent postRemovedEvent) { removePost(postRemovedEvent.getPost()); }