diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2014-03-24 21:38:02 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2014-03-31 19:39:30 -0700 |
commit | cfb2c5ef6582e51ae9cfdfff35e12b5b7fdc24fb (patch) | |
tree | 88df0d7004d73e113f6f9c95c599bd27ff91110f /src/com/p4square/grow/frontend/FeedData.java | |
parent | 44de44ac6a3879c78b7e31d7e460bb0125275237 (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.java | 15 |
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; + } } |