- allPosts = Filters.filteredList(allPosts, new Filter<Post>() {
-
- @Override
- public boolean filterObject(Post post) {
- return ListNotificationFilters.isPostVisible(currentSone, post);
- }
- });
- allPosts = Filters.filteredList(allPosts, Post.FUTURE_POSTS_FILTER);
- Collections.sort(allPosts, Post.TIME_COMPARATOR);
- Pagination<Post> pagination = new Pagination<Post>(allPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("page"), 0));
+ allPosts = Collections2.filter(allPosts, postVisibilityFilter.isVisible(currentSone));
+ List<Post> sortedPosts = new ArrayList<Post>(allPosts);
+ Collections.sort(sortedPosts, Post.NEWEST_FIRST);
+ Pagination<Post> pagination = new Pagination<Post>(sortedPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(parseInt(request.getHttpRequest().getParam("page"), 0));