X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FViewSonePage.java;h=14c4f9445965538a2c48c2f5a398f2b59f46a052;hb=e3395d9dd51f56240e4cb9509ccd403bf5f9e343;hp=82284d59dfa9346447899868c4070131c7244d68;hpb=9d341071d7fc10118038e238d29ce7bd38ff08c4;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java index 82284d5..14c4f94 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java @@ -29,7 +29,6 @@ import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.Reply; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.template.SoneAccessor; -import net.pterodactylus.util.collection.ListBuilder; import net.pterodactylus.util.collection.Pagination; import net.pterodactylus.util.number.Numbers; import net.pterodactylus.util.template.Template; @@ -84,7 +83,7 @@ public class ViewSonePage extends SoneTemplatePage { List sonePosts = sone.getPosts(); sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone)); Collections.sort(sonePosts, Post.TIME_COMPARATOR); - Pagination postPagination = new Pagination(sonePosts, 10).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("postPage"), 0)); + Pagination postPagination = new Pagination(sonePosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("postPage"), 0)); templateContext.set("postPagination", postPagination); templateContext.set("posts", postPagination.getItems()); Set replies = sone.getReplies(); @@ -106,20 +105,9 @@ public class ViewSonePage extends SoneTemplatePage { }); - Pagination repliedPostPagination = new Pagination(posts, 10).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("repliedPostPage"), 0)); + Pagination repliedPostPagination = new Pagination(posts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("repliedPostPage"), 0)); templateContext.set("repliedPostPagination", repliedPostPagination); templateContext.set("repliedPosts", repliedPostPagination.getItems()); - - /* mark Sone and posts and replies as known. */ - webInterface.getCore().markSoneKnown(sone); - for (Post post : new ListBuilder().addAll(postPagination.getItems()).addAll(repliedPostPagination.getItems()).get()) { - if (post.getSone() != null) { - webInterface.getCore().markPostKnown(post); - } - for (Reply reply : webInterface.getCore().getReplies(post)) { - webInterface.getCore().markReplyKnown(reply); - } - } } }