X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FGetPostCommand.java;h=a6f1ae8bc37550e550769f10106a8d1056bb1404;hp=3955db94f3ec52835193a6ece194e39634fa95f3;hb=4f1c79caddd4f38e9639f054f7a8800c2a5627b3;hpb=85db4f5003d130a2042d1481bc1b9e641e9f69df diff --git a/src/main/java/net/pterodactylus/sone/fcp/GetPostCommand.java b/src/main/java/net/pterodactylus/sone/fcp/GetPostCommand.java index 3955db9..a6f1ae8 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/GetPostCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/GetPostCommand.java @@ -1,5 +1,5 @@ /* - * Sone - GetPostCommand.java - Copyright © 2011 David Roden + * Sone - GetPostCommand.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 @@ -21,7 +21,6 @@ import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.freenet.fcp.FcpException; import freenet.support.SimpleFieldSet; -import freenet.support.api.Bucket; /** * The “GetPost” FCP command returns a single {@link Post} to an FCP client. @@ -36,7 +35,7 @@ public class GetPostCommand extends AbstractSoneCommand { * @param core * The Sone core */ - protected GetPostCommand(Core core) { + public GetPostCommand(Core core) { super(core); } @@ -44,9 +43,11 @@ public class GetPostCommand extends AbstractSoneCommand { * {@inheritDoc} */ @Override - public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { + public Response execute(SimpleFieldSet parameters) throws FcpException { Post post = getPost(parameters, "Post"); - return new Response(encodePost(post, "Post.", true)); + boolean includeReplies = getBoolean(parameters, "IncludeReplies", true); + + return new Response("Post", encodePost(post, "Post.", includeReplies)); } }