X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FMarkAsKnownAjaxPage.java;h=370bacde28502f94451e8bf05f3fd89c9ee33972;hp=5bcb55b2fe95a54b1ab605ac0b97f09bd3508477;hb=a47643aed43d118ca68044f95451bb5374cdb332;hpb=5e551a748ec4421f370480ac2de5f11bfc99c9d4 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 5bcb55b..370bacd 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - MarkAsKnownAjaxPage.java - Copyright © 2011 David Roden + * Sone - MarkAsKnownAjaxPage.java - Copyright © 2011–2012 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 @@ -19,9 +19,11 @@ package net.pterodactylus.sone.web.ajax; 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; /** @@ -46,12 +48,12 @@ public class MarkAsKnownAjaxPage extends JsonPage { * {@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")) { @@ -61,7 +63,7 @@ public class MarkAsKnownAjaxPage extends JsonPage { } core.markPostKnown(post); } else if (type.equals("reply")) { - Reply reply = core.getReply(id, false); + PostReply reply = core.getReply(id, false); if (reply == null) { continue; }