X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FGetPostCommand.java;h=664202c4a4dddc8fc82e34dd9939138829f1f261;hb=7fb49938b9198110c34bcc600c545bfa91acf6f2;hp=3955db94f3ec52835193a6ece194e39634fa95f3;hpb=85db4f5003d130a2042d1481bc1b9e641e9f69df;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/fcp/GetPostCommand.java b/src/main/java/net/pterodactylus/sone/fcp/GetPostCommand.java index 3955db9..664202c 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–2013 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 @@ -36,17 +36,16 @@ public class GetPostCommand extends AbstractSoneCommand { * @param core * The Sone core */ - protected GetPostCommand(Core core) { + public GetPostCommand(Core core) { super(core); } - /** - * {@inheritDoc} - */ @Override public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { Post post = getPost(parameters, "Post"); - return new Response(encodePost(post, "Post.", true)); + boolean includeReplies = getBoolean(parameters, "IncludeReplies", true); + + return new Response("Post", includeReplies ? encodePostWithReplies(post, "Post.") : encodePost(post, "Post.")); } }