X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FViewPostPage.java;h=3bc3b3673740f160643b81842c848e3403e02e41;hb=533720edfdc8c59088db00fef5374c6a8f461a1a;hp=a013198af55ecb3edf4f215d8370c66f43ce7d35;hpb=fd30c0adf935d90f496671d9122f5ab0b9043670;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java index a013198..3bc3b36 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java @@ -18,6 +18,7 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Post; +import net.pterodactylus.sone.data.Reply; import net.pterodactylus.util.template.Template; /** @@ -36,7 +37,7 @@ public class ViewPostPage extends SoneTemplatePage { * The Sone web interface */ public ViewPostPage(Template template, WebInterface webInterface) { - super("viewPost.html", template, "Page.ViewPost.Title", webInterface); + super("viewPost.html", template, "Page.ViewPost.Title", webInterface, false); } // @@ -48,21 +49,22 @@ public class ViewPostPage extends SoneTemplatePage { */ @Override protected void processTemplate(Request request, Template template) throws RedirectException { + super.processTemplate(request, template); String postId = request.getHttpRequest().getParam("post"); - Post post = webInterface.core().getPost(postId); + Post post = webInterface.getCore().getPost(postId); template.set("post", post); } - // - // SONETEMPLATEPAGE METHODS - // - /** * {@inheritDoc} */ @Override - protected boolean requiresLogin() { - return true; + protected void postProcess(Request request, Template template) { + Post post = (Post) template.get("post"); + webInterface.getCore().markPostKnown(post); + for (Reply reply : webInterface.getCore().getReplies(post)) { + webInterface.getCore().markReplyKnown(reply); + } } }