From: David ‘Bombe’ Roden Date: Tue, 5 Apr 2011 09:04:10 +0000 (+0200) Subject: Remove notification if no posts and replies remain. X-Git-Tag: 0.6.1^2~36 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=fbd56494f4d26e59ae3872ac2276f631a81da085;p=Sone.git Remove notification if no posts and replies remain. --- diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java index c4bc728..7da4831 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java @@ -103,6 +103,9 @@ public class ListNotificationFilters { newPosts.add(post); } } + if (newPosts.isEmpty()) { + return null; + } if (newPosts.size() == newPostNotification.getElements().size()) { return newPostNotification; } @@ -138,6 +141,9 @@ public class ListNotificationFilters { newReplies.add(reply); } } + if (newReplies.isEmpty()) { + return null; + } if (newReplies.size() == newReplyNotification.getElements().size()) { return newReplyNotification; }