X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FNewPage.java;h=71200d85ab68c44ef0a8bb22386c6b0faf5fa6d0;hp=2d4ec5582852724d3769928f21d77a8e9f171273;hb=f30eb5d4dbcd631aaff76a5e52a3d4cbe8d10c27;hpb=9cb50c365e3bf7a74ffa40a45630a0e7be40b526 diff --git a/src/main/java/net/pterodactylus/sone/web/NewPage.java b/src/main/java/net/pterodactylus/sone/web/NewPage.java index 2d4ec55..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,8 +68,8 @@ public class NewPage extends SoneTemplatePage { /* 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. */