From e1da0315a8a0f46412332465ed95484f97ee6d7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 8 Apr 2011 06:49:17 +0200 Subject: [PATCH] Also show posts and replies that have the current Sone as post recipient. --- .../java/net/pterodactylus/sone/notify/ListNotificationFilters.java | 4 ++-- src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java index 813b82d..2a98ec8 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java @@ -90,7 +90,7 @@ public class ListNotificationFilters { } List newPosts = new ArrayList(); 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); } } @@ -125,7 +125,7 @@ public class ListNotificationFilters { } List newReplies = new ArrayList(); 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); } } diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java index 69d831d..426c08f 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -97,7 +97,7 @@ public class GetStatusAjaxPage extends JsonPage { @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) { - 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()); } }); -- 2.7.4