From f30eb5d4dbcd631aaff76a5e52a3d4cbe8d10c27 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 25 Jan 2013 18:19:33 +0100 Subject: [PATCH] Only list replies whose posts exist. --- src/main/java/net/pterodactylus/sone/web/NewPage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/NewPage.java b/src/main/java/net/pterodactylus/sone/web/NewPage.java index 22d27c8..71200d8 100644 --- a/src/main/java/net/pterodactylus/sone/web/NewPage.java +++ b/src/main/java/net/pterodactylus/sone/web/NewPage.java @@ -23,6 +23,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import com.google.common.collect.Collections2; + import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.notify.ListNotificationFilters; @@ -66,7 +68,7 @@ public class NewPage extends SoneTemplatePage { /* collect new elements from notifications. */ Set posts = new HashSet(webInterface.getNewPosts()); - for (PostReply reply : webInterface.getNewReplies()) { + for (PostReply reply : Collections2.filter(webInterface.getNewReplies(), PostReply.HAS_POST_FILTER)) { posts.add(reply.getPost().get()); } -- 2.7.4