X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FDeleteReplyCommand.java;h=6a018facdae32fb75f2239b9e1c210c87b694536;hb=8775a0be01123cc2b3375cb1f3f61a260d29b1ad;hp=daed26dd2a6acbb814be87f2fb3fbfc0384c47ae;hpb=50ce65f69e49ed10abeedaeb6615ffb37a0c0772;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/fcp/DeleteReplyCommand.java b/src/main/java/net/pterodactylus/sone/fcp/DeleteReplyCommand.java index daed26d..6a018fa 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–2012 David Roden + * Sone - DeleteReplyCommand.java - Copyright © 2011–2016 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 @@ -48,9 +48,10 @@ public class DeleteReplyCommand extends AbstractSoneCommand { @Override public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { PostReply reply = getReply(parameters, "Reply"); - if (!getCore().isLocalSone(reply.getSone())) { + if (!reply.getSone().isLocal()) { return new ErrorResponse(401, "Not allowed."); } + getCore().deleteReply(reply); return new Response("ReplyDeleted", new SimpleFieldSetBuilder().get()); }