Use method.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 27 Apr 2011 19:47:00 +0000 (21:47 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 27 Apr 2011 19:47:00 +0000 (21:47 +0200)
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java

index 7491e70..207f4cc 100644 (file)
@@ -93,7 +93,7 @@ public class ListNotificationFilters {
                }
                List<Post> newPosts = new ArrayList<Post>();
                for (Post post : newPostNotification.getElements()) {
-                       if ((post.getSone() != null) && (currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone()) || currentSone.equals(post.getRecipient()))) {
+                       if (isPostVisible(currentSone, post)) {
                                newPosts.add(post);
                        }
                }
@@ -128,7 +128,7 @@ public class ListNotificationFilters {
                }
                List<Reply> newReplies = new ArrayList<Reply>();
                for (Reply reply : newReplyNotification.getElements()) {
-                       if (((reply.getPost().getSone() != null) && currentSone.hasFriend(reply.getPost().getSone().getId())) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient())) {
+                       if (isPostVisible(currentSone, reply.getPost())) {
                                newReplies.add(reply);
                        }
                }