X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FDeleteReplyAjaxPage.java;h=2505c393a2947de1d48bef3103ca7d0ad5bdb460;hb=a88e930a23b550dae75116d7759924d760941776;hp=f34d2021cb5bab581e85092b49c72c37b290f9da;hpb=f840f1f3508b5e09cee9e95182c47775a5a2dc2e;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java index f34d202..2505c39 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - DeleteReplysAjaxPage.java - Copyright © 2010 David Roden + * Sone - DeleteReplyAjaxPage.java - Copyright © 2010–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 @@ -17,8 +17,9 @@ package net.pterodactylus.sone.web.ajax; -import net.pterodactylus.sone.data.Reply; +import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.web.WebInterface; +import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.json.JsonObject; /** @@ -46,13 +47,13 @@ public class DeleteReplyAjaxPage extends JsonPage { * {@inheritDoc} */ @Override - protected JsonObject createJsonObject(Request request) { + protected JsonObject createJsonObject(FreenetRequest request) { String replyId = request.getHttpRequest().getParam("reply"); - Reply reply = webInterface.getCore().getReply(replyId); + PostReply reply = webInterface.getCore().getPostReply(replyId, false); if (reply == null) { return createErrorJsonObject("invalid-reply-id"); } - if (!webInterface.getCore().isLocalSone(reply.getSone())) { + if (!reply.getSone().isLocal()) { return createErrorJsonObject("not-authorized"); } webInterface.getCore().deleteReply(reply);