From adba5974bae4da0def1f13d47cfcf28a37e3cf7a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Mon, 24 Mar 2014 21:38:02 -0700 Subject: Enabling the Feed and various bug fixes. * Fixing thread ordering. * Adding a limit of 5 threads per topic. * Changing frontend /account references to UserRecord. --- src/com/p4square/grow/frontend/FeedData.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/com/p4square/grow/frontend/FeedData.java') 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(clientDispatcher, Message.class); } - public List 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 getThreads(final String topic, final int limit) throws IOException { + return mThreadsProvider.get(makeUrl(limit, topic)); } public List 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; + } } -- cgit v1.2.3