summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/frontend/FeedData.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2014-03-24 21:38:02 -0700
committerJesse Morgan <jesse@jesterpm.net>2014-03-31 19:39:30 -0700
commitadba5974bae4da0def1f13d47cfcf28a37e3cf7a (patch)
treee660c0090f942d4ac846666b0aabdfe83ea020e9 /src/com/p4square/grow/frontend/FeedData.java
parentbe16eedfb3570da2dcd3975948419ecc3d996253 (diff)
Enabling the Feed and various bug fixes.
* Fixing thread ordering. * Adding a limit of 5 threads per topic. * Changing frontend /account references to UserRecord.
Diffstat (limited to 'src/com/p4square/grow/frontend/FeedData.java')
-rw-r--r--src/com/p4square/grow/frontend/FeedData.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/p4square/grow/frontend/FeedData.java b/src/com/p4square/grow/frontend/FeedData.java
index 55e845c..feb03a1 100644
--- a/src/com/p4square/grow/frontend/FeedData.java
+++ b/src/com/p4square/grow/frontend/FeedData.java
@@ -62,8 +62,15 @@ public class FeedData {
mMessageProvider = new JsonRequestProvider<Message>(clientDispatcher, Message.class);
}
- public List<MessageThread> getThreads(final String topic) throws IOException {
- return mThreadsProvider.get(makeUrl(topic));
+ /**
+ * Get the threads for a topic.
+ *
+ * @param topic The topic to request threads for.
+ * @param limit The maximum number of threads.
+ * @return A list of MessageThread objects.
+ */
+ public List<MessageThread> getThreads(final String topic, final int limit) throws IOException {
+ return mThreadsProvider.get(makeUrl(limit, topic));
}
public List<Message> getMessages(final String topic, final String threadId) throws IOException {
@@ -91,4 +98,8 @@ public class FeedData {
return url;
}
+
+ private String makeUrl(int limit, String... parts) {
+ return makeUrl(parts) + "?limit=" + limit;
+ }
}