Remove method to mark replies as known from the core.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / MarkAsKnownAjaxPage.java
index cd026ef..fb602db 100644 (file)
@@ -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> post = core.getPost(id);
+                               Optional<Post> post = core.getDatabase().getPost(id);
                                if (!post.isPresent()) {
                                        continue;
                                }
                                core.markPostKnown(post.get());
                        } else if (type.equals("reply")) {
-                               Optional<PostReply> reply = core.getPostReply(id);
+                               Optional<PostReply> 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> 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;