X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FGetPostFeedCommand.java;h=895c1c6c05ffa04b97f7b4e6fa578169ac5ad4b1;hb=a502beddd4dee5354c0955ea1436d4e49f5488f6;hp=2dc59a1b3ab9247d371c9db8b552689befc2a51d;hpb=a50303a787867cdc2449da8846e1e365b771e109;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java b/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java index 2dc59a1..895c1c6 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java @@ -53,7 +53,7 @@ public class GetPostFeedCommand extends AbstractSoneCommand { * {@inheritDoc} */ @Override - public Reply execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { + public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { Sone sone = getSone(parameters, "Sone"); int startPost = getInt(parameters, "StartPost", 0); int maxPosts = getInt(parameters, "MaxPosts", -1); @@ -73,10 +73,10 @@ public class GetPostFeedCommand extends AbstractSoneCommand { Collections.sort(sortedPosts, Post.TIME_COMPARATOR); if (sortedPosts.size() < startPost) { - return new Reply(encodePosts(Collections. emptyList())); + return new Response(encodePosts(Collections. emptyList(), "Posts.", false)); } - return new Reply(encodePosts(sortedPosts.subList(startPost, (maxPosts == -1) ? sortedPosts.size() : Math.min(startPost + maxPosts, sortedPosts.size())))); + return new Response(encodePosts(sortedPosts.subList(startPost, (maxPosts == -1) ? sortedPosts.size() : Math.min(startPost + maxPosts, sortedPosts.size())), "Posts.", true)); } }