Also show posts and replies that have the current Sone as post recipient.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 8 Apr 2011 04:49:17 +0000 (06:49 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 8 Apr 2011 04:49:17 +0000 (06:49 +0200)
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java

index 813b82d..2a98ec8 100644 (file)
@@ -90,7 +90,7 @@ public class ListNotificationFilters {
                }
                List<Post> newPosts = new ArrayList<Post>();
                for (Post post : newPostNotification.getElements()) {
                }
                List<Post> newPosts = new ArrayList<Post>();
                for (Post post : newPostNotification.getElements()) {
-                       if (currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone())) {
+                       if (currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone()) || currentSone.equals(post.getRecipient())) {
                                newPosts.add(post);
                        }
                }
                                newPosts.add(post);
                        }
                }
@@ -125,7 +125,7 @@ public class ListNotificationFilters {
                }
                List<Reply> newReplies = new ArrayList<Reply>();
                for (Reply reply : newReplyNotification.getElements()) {
                }
                List<Reply> newReplies = new ArrayList<Reply>();
                for (Reply reply : newReplyNotification.getElements()) {
-                       if (currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone())) {
+                       if (currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient())) {
                                newReplies.add(reply);
                        }
                }
                                newReplies.add(reply);
                        }
                }
index 69d831d..426c08f 100644 (file)
@@ -97,7 +97,7 @@ public class GetStatusAjaxPage extends JsonPage {
 
                                @Override
                                public boolean filterObject(Post post) {
 
                                @Override
                                public boolean filterObject(Post post) {
-                                       return currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone());
+                                       return currentSone.hasFriend(post.getSone().getId()) || currentSone.equals(post.getSone()) || currentSone.equals(post.getRecipient());
                                }
 
                        });
                                }
 
                        });
@@ -118,7 +118,7 @@ public class GetStatusAjaxPage extends JsonPage {
 
                                @Override
                                public boolean filterObject(Reply reply) {
 
                                @Override
                                public boolean filterObject(Reply reply) {
-                                       return currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone());
+                                       return currentSone.hasFriend(reply.getPost().getSone().getId()) || currentSone.equals(reply.getPost().getSone()) || currentSone.equals(reply.getPost().getRecipient());
                                }
 
                        });
                                }
 
                        });