Merge branch 'release-0.9.6'
[Sone.git] / src / main / java / net / pterodactylus / sone / web / BookmarksPage.java
index a86e044..b273bdb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - BookmarksPage.java - Copyright © 2011–2015 David Roden
+ * Sone - BookmarksPage.java - Copyright © 2011–2016 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
@@ -61,8 +61,7 @@ public class BookmarksPage extends SoneTemplatePage {
         * {@inheritDoc}
         */
        @Override
-       protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
-               super.processTemplate(request, templateContext);
+       protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                Set<Post> allPosts = webInterface.getCore().getBookmarkedPosts();
                Collection<Post> loadedPosts = Collections2.filter(allPosts, new Predicate<Post>() {
 
@@ -72,7 +71,7 @@ public class BookmarksPage extends SoneTemplatePage {
                        }
                });
                List<Post> sortedPosts = new ArrayList<Post>(loadedPosts);
-               Collections.sort(sortedPosts, Post.TIME_COMPARATOR);
+               Collections.sort(sortedPosts, Post.NEWEST_FIRST);
                Pagination<Post> pagination = new Pagination<Post>(sortedPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(parseInt(request.getHttpRequest().getParam("page"), 0));
                templateContext.set("pagination", pagination);
                templateContext.set("posts", pagination.getItems());