diff options
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; + } } |