X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=db1880bb6aed1b15942a6a8a71bef6485891c212;hb=2a9b6883dfa5a8e2d13c1ab0fbe8b30c609bf9e9;hp=e16ca9dc7ecef271af22876eed22d14ac2aa1920;hpb=c93070476a62e3db94f175576e3cdabf49db1086;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 e16ca9d..db1880b 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -37,9 +37,7 @@ import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.freenet.L10nFilter; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.main.SonePlugin; -import net.pterodactylus.sone.notify.NewPostNotification; -import net.pterodactylus.sone.notify.NewReplyNotification; -import net.pterodactylus.sone.notify.NewSoneNotification; +import net.pterodactylus.sone.notify.ListNotification; import net.pterodactylus.sone.template.CollectionAccessor; import net.pterodactylus.sone.template.CssClassNameFilter; import net.pterodactylus.sone.template.GetPagePlugin; @@ -113,13 +111,13 @@ public class WebInterface implements CoreListener { private DefaultTemplateFactory templateFactory; /** The “new Sone” notification. */ - private final NewSoneNotification newSoneNotification; + private final ListNotification newSoneNotification; /** The “new post” notification. */ - private final NewPostNotification newPostNotification; + private final ListNotification newPostNotification; /** The “new reply” notification. */ - private final NewReplyNotification newReplyNotification; + private final ListNotification newReplyNotification; /** * Creates a new web interface. @@ -153,13 +151,13 @@ public class WebInterface implements CoreListener { /* create notifications. */ Template newSoneNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newSoneNotification.html")); - newSoneNotification = new NewSoneNotification(newSoneNotificationTemplate); + newSoneNotification = new ListNotification("new-sone-notification", "sones", newSoneNotificationTemplate); Template newPostNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newPostNotification.html")); - newPostNotification = new NewPostNotification(newPostNotificationTemplate); + newPostNotification = new ListNotification("new-post-notification", "posts", newPostNotificationTemplate); Template newReplyNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newReplyNotification.html")); - newReplyNotification = new NewReplyNotification(newReplyNotificationTemplate); + newReplyNotification = new ListNotification("new-replies-notification", "replies", newReplyNotificationTemplate); } // @@ -390,7 +388,7 @@ public class WebInterface implements CoreListener { */ @Override public void newSoneFound(Sone sone) { - newSoneNotification.addSone(sone); + newSoneNotification.add(sone); notificationManager.addNotification(newSoneNotification); } @@ -399,7 +397,7 @@ public class WebInterface implements CoreListener { */ @Override public void newPostFound(Post post) { - newPostNotification.addPost(post); + newPostNotification.add(post); notificationManager.addNotification(newPostNotification); } @@ -411,7 +409,7 @@ public class WebInterface implements CoreListener { if (reply.getPost().getSone() == null) { return; } - newReplyNotification.addReply(reply); + newReplyNotification.add(reply); notificationManager.addNotification(newReplyNotification); } @@ -420,7 +418,7 @@ public class WebInterface implements CoreListener { */ @Override public void markSoneKnown(Sone sone) { - newSoneNotification.removeSone(sone); + newSoneNotification.remove(sone); if (newSoneNotification.isEmpty()) { newSoneNotification.dismiss(); } @@ -431,7 +429,7 @@ public class WebInterface implements CoreListener { */ @Override public void markPostKnown(Post post) { - newPostNotification.removePost(post); + newPostNotification.remove(post); if (newPostNotification.isEmpty()) { newPostNotification.dismiss(); } @@ -442,7 +440,7 @@ public class WebInterface implements CoreListener { */ @Override public void markReplyKnown(Reply reply) { - newReplyNotification.removeReply(reply); + newReplyNotification.remove(reply); if (newReplyNotification.isEmpty()) { newReplyNotification.dismiss(); }