X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FMarkAsKnownAjaxPage.java;h=fb602db0eaa3d2e1665a6b98810ce34c30889c06;hb=f1a337e97c0188170e8ea8bb06b99324f3a07dee;hp=cd026ef2b9a5043a87f3c40819991b525ab520ef;hpb=629ddb006542df2b671e172d8f544815bbab639b;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java index cd026ef..fb602db 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java @@ -45,9 +45,6 @@ public class MarkAsKnownAjaxPage extends JsonPage { super("markAsKnown.ajax", webInterface); } - /** - * {@inheritDoc} - */ @Override protected JsonReturnObject createJsonObject(FreenetRequest request) { String type = request.getHttpRequest().getParam("type"); @@ -58,17 +55,17 @@ public class MarkAsKnownAjaxPage extends JsonPage { Core core = webInterface.getCore(); for (String id : ids) { if (type.equals("post")) { - Optional post = core.getPost(id); + Optional post = core.getDatabase().getPost(id); if (!post.isPresent()) { continue; } core.markPostKnown(post.get()); } else if (type.equals("reply")) { - Optional reply = core.getPostReply(id); + Optional reply = core.getDatabase().getPostReply(id); if (!reply.isPresent()) { continue; } - core.markReplyKnown(reply.get()); + reply.get().modify().setKnown().update(webInterface.getCore().postReplyUpdated()); } else if (type.equals("sone")) { Optional sone = core.getSone(id); if (!sone.isPresent()) { @@ -80,9 +77,6 @@ public class MarkAsKnownAjaxPage extends JsonPage { return createSuccessJsonObject(); } - /** - * {@inheritDoc} - */ @Override protected boolean requiresLogin() { return false;