X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=115e0c3b201272e614467828f59a80f9154570cb;hb=06ed021f1232830b8617efdb4c2d26684a18b643;hp=87f823815514d20bfd4504368dbb2fc07904c76a;hpb=e02217de335935a40c4d41df7fdc162d5222c718;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 87f8238..115e0c3 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -38,6 +38,7 @@ 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.template.CollectionAccessor; import net.pterodactylus.sone.template.CssClassNameFilter; @@ -114,6 +115,9 @@ public class WebInterface implements CoreListener { /** The “new post” notification. */ private final NewPostNotification newPostNotification; + /** The “new reply” notification. */ + private final NewReplyNotification newReplyNotification; + /** * Creates a new web interface. * @@ -150,6 +154,9 @@ public class WebInterface implements CoreListener { Template newPostNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newPostNotification.html")); newPostNotification = new NewPostNotification(newPostNotificationTemplate); + + Template newReplyNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newReplyNotification.html")); + newReplyNotification = new NewReplyNotification(newReplyNotificationTemplate); } // @@ -375,7 +382,8 @@ public class WebInterface implements CoreListener { */ @Override public void newReplyFound(Reply reply) { - /* TODO */ + newReplyNotification.addReply(reply); + notificationManager.addNotification(newReplyNotification); } /** @@ -405,7 +413,10 @@ public class WebInterface implements CoreListener { */ @Override public void markReplyKnown(Reply reply) { - /* TODO */ + newReplyNotification.removeReply(reply); + if (newReplyNotification.isEmpty()) { + newReplyNotification.dismiss(); + } } /**