Use post- and reply-visibility methods.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 6 May 2011 22:40:39 +0000 (00:40 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 6 May 2011 22:40:39 +0000 (00:40 +0200)
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java

index 9531a6d..b28b82e 100644 (file)
@@ -93,7 +93,7 @@ public class GetStatusAjaxPage extends JsonPage {
 
                                @Override
                                public boolean filterObject(Post post) {
-                                       return currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone()) || currentSone.equals(post.getRecipient());
+                                       return ListNotificationFilters.isPostVisible(currentSone, post);
                                }
 
                        });
@@ -114,7 +114,7 @@ public class GetStatusAjaxPage extends JsonPage {
 
                                @Override
                                public boolean filterObject(Reply reply) {
-                                       return (reply.getPost() != null) && (reply.getPost().getSone() != null) && (currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient()));
+                                       return ListNotificationFilters.isReplyVisible(currentSone, reply);
                                }
 
                        });