From fbd56494f4d26e59ae3872ac2276f631a81da085 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 5 Apr 2011 11:04:10 +0200 Subject: [PATCH] Remove notification if no posts and replies remain. --- .../java/net/pterodactylus/sone/notify/ListNotificationFilters.java | 6 ++++++ 1 file changed, 6 insertions(+) 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; } -- 2.7.4