super("markAsKnown.ajax", webInterface);
}
- /**
- * {@inheritDoc}
- */
@Override
protected JsonReturnObject createJsonObject(FreenetRequest request) {
String type = request.getHttpRequest().getParam("type");
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()) {
return createSuccessJsonObject();
}
- /**
- * {@inheritDoc}
- */
@Override
protected boolean requiresLogin() {
return false;