/*
- * Sone - MarkAsKnownAjaxPage.java - Copyright © 2011 David Roden
+ * Sone - MarkAsKnownAjaxPage.java - Copyright © 2011–2013 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.data.PostReply;
import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.WebInterface;
+import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.json.JsonObject;
/**
* {@inheritDoc}
*/
@Override
- protected JsonObject createJsonObject(Request request) {
+ protected JsonObject createJsonObject(FreenetRequest request) {
String type = request.getHttpRequest().getParam("type");
if (!type.equals("sone") && !type.equals("post") && !type.equals("reply")) {
return createErrorJsonObject("invalid-type");
}
- String[] ids = request.getHttpRequest().getParam("ids").split(" ");
+ String[] ids = request.getHttpRequest().getParam("id").split(" ");
Core core = webInterface.getCore();
for (String id : ids) {
if (type.equals("post")) {
- Post post = core.getPost(id, false);
+ Post post = core.getPost(id);
if (post == null) {
continue;
}
core.markPostKnown(post);
} else if (type.equals("reply")) {
- Reply reply = core.getReply(id, false);
+ PostReply reply = core.getPostReply(id, false);
if (reply == null) {
continue;
}