/*
- * Sone - ViewSonePage.java - Copyright © 2010–2015 David Roden
+ * Sone - ViewSonePage.java - Copyright © 2010–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
* {@inheritDoc}
*/
@Override
- protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
- super.processTemplate(request, templateContext);
+ protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
String soneId = request.getHttpRequest().getParam("sone");
Optional<Sone> sone = webInterface.getCore().getSone(soneId);
templateContext.set("sone", sone.orNull());
}
List<Post> sonePosts = sone.get().getPosts();
sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone.get().getId()));
- Collections.sort(sonePosts, Post.TIME_COMPARATOR);
+ Collections.sort(sonePosts, Post.NEWEST_FIRST);
Pagination<Post> postPagination = new Pagination<Post>(sonePosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(parseInt(request.getHttpRequest().getParam("postPage"), 0));
templateContext.set("postPagination", postPagination);
templateContext.set("posts", postPagination.getItems());