Change all copyright headers to include 2012.
[Sone.git] / src / main / java / net / pterodactylus / sone / fcp / GetPostFeedCommand.java
index f1ff9a8..2c44dbf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - GetPostFeedCommand.java - Copyright © 2011 David Roden
+ * Sone - GetPostFeedCommand.java - Copyright © 2011–2012 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
@@ -54,7 +54,7 @@ public class GetPostFeedCommand extends AbstractSoneCommand {
         */
        @Override
        public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
-               Sone sone = getSone(parameters, "Sone");
+               Sone sone = getSone(parameters, "Sone", true);
                int startPost = getInt(parameters, "StartPost", 0);
                int maxPosts = getInt(parameters, "MaxPosts", -1);
 
@@ -64,7 +64,7 @@ public class GetPostFeedCommand extends AbstractSoneCommand {
                        if (!getCore().hasSone(friendSoneId)) {
                                continue;
                        }
-                       allPosts.addAll(getCore().getSone(friendSoneId).getPosts());
+                       allPosts.addAll(getCore().getSone(friendSoneId, false).getPosts());
                }
                allPosts.addAll(getCore().getDirectedPosts(sone));
                allPosts = Filters.filteredSet(allPosts, Post.FUTURE_POSTS_FILTER);
@@ -73,10 +73,10 @@ public class GetPostFeedCommand extends AbstractSoneCommand {
                Collections.sort(sortedPosts, Post.TIME_COMPARATOR);
 
                if (sortedPosts.size() < startPost) {
-                       return new Response(encodePosts(Collections.<Post> emptyList(), false));
+                       return new Response("PostFeed", encodePosts(Collections.<Post> emptyList(), "Posts.", false));
                }
 
-               return new Response(encodePosts(sortedPosts.subList(startPost, (maxPosts == -1) ? sortedPosts.size() : Math.min(startPost + maxPosts, sortedPosts.size())), true));
+               return new Response("PostFeed", encodePosts(sortedPosts.subList(startPost, (maxPosts == -1) ? sortedPosts.size() : Math.min(startPost + maxPosts, sortedPosts.size())), "Posts.", true));
        }
 
 }