Remove notification if no posts and replies remain.
[Sone.git] / src / main / java / net / pterodactylus / sone / notify / ListNotificationFilters.java
index c4bc728..7da4831 100644 (file)
@@ -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;
                }