/*
- * 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
* @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");
boolean includeReplies = getBoolean(parameters, "IncludeReplies", true);
- return new Response("Post", encodePost(post, "Post.", includeReplies));
+ return new Response("Post", includeReplies ? encodePostWithReplies(post, "Post.") : encodePost(post, "Post."));
}
}