X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FNewPage.java;h=7973d2890b26b6089d83c2cc97cbdc1efc7d8df9;hb=cb7aebca2a351028dd4fdd00dcd637c6aafac79b;hp=2d4ec5582852724d3769928f21d77a8e9f171273;hpb=99888ce13cc17d49f5e217ab6f2c9ad5ef168792;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/NewPage.java b/src/main/java/net/pterodactylus/sone/web/NewPage.java index 2d4ec55..7973d28 100644 --- a/src/main/java/net/pterodactylus/sone/web/NewPage.java +++ b/src/main/java/net/pterodactylus/sone/web/NewPage.java @@ -32,6 +32,8 @@ import net.pterodactylus.util.number.Numbers; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; +import com.google.common.collect.Collections2; + /** * Page that displays all new posts and replies. The posts are filtered using * {@link ListNotificationFilters#filterPosts(java.util.Collection, net.pterodactylus.sone.data.Sone)} @@ -57,17 +59,14 @@ public class NewPage extends SoneTemplatePage { // SONETEMPLATEPAGE METHODS // - /** - * {@inheritDoc} - */ @Override protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); /* collect new elements from notifications. */ Set posts = new HashSet(webInterface.getNewPosts()); - for (PostReply reply : webInterface.getNewReplies()) { - posts.add(reply.getPost()); + for (PostReply reply : Collections2.filter(webInterface.getNewReplies(), PostReply.HAS_POST_FILTER)) { + posts.add(reply.getPost().get()); } /* filter and sort them. */