X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FDeleteReplyCommand.java;h=8b2f5b7f0913207bf298b692d07ab53f1947f7b3;hp=601455a4be9d2a24150a45a659eba8e4a1eb04ba;hb=419098bcd6215125408b29e60bd888e60979d37b;hpb=01bc879f0f7f33c5321f3ac1ed9bfccf0ab4b433 diff --git a/src/main/java/net/pterodactylus/sone/fcp/DeleteReplyCommand.java b/src/main/java/net/pterodactylus/sone/fcp/DeleteReplyCommand.java index 601455a..8b2f5b7 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/DeleteReplyCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/DeleteReplyCommand.java @@ -1,5 +1,5 @@ /* - * Sone - DeleteReplyCommand.java - Copyright © 2011 David Roden + * Sone - DeleteReplyCommand.java - Copyright © 2011–2015 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 @@ -18,16 +18,16 @@ package net.pterodactylus.sone.fcp; import net.pterodactylus.sone.core.Core; -import net.pterodactylus.sone.data.Reply; +import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.freenet.SimpleFieldSetBuilder; import net.pterodactylus.sone.freenet.fcp.FcpException; import freenet.support.SimpleFieldSet; import freenet.support.api.Bucket; /** - * FCP command that deletes a {@link Reply}. + * FCP command that deletes a {@link PostReply}. * - * @see Core#deleteReply(Reply) + * @see Core#deleteReply(PostReply) * @author David ‘Bombe’ Roden */ public class DeleteReplyCommand extends AbstractSoneCommand { @@ -39,7 +39,7 @@ public class DeleteReplyCommand extends AbstractSoneCommand { * The Sone core */ public DeleteReplyCommand(Core core) { - super(core); + super(core, true); } /** @@ -47,8 +47,8 @@ public class DeleteReplyCommand extends AbstractSoneCommand { */ @Override public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { - Reply reply = getReply(parameters, "Reply"); - if (!getCore().isLocalSone(reply.getSone())) { + PostReply reply = getReply(parameters, "Reply"); + if (!reply.getSone().isLocal()) { return new ErrorResponse(401, "Not allowed."); } return new Response("ReplyDeleted", new SimpleFieldSetBuilder().get());