From: David ‘Bombe’ Roden Date: Fri, 8 Apr 2011 04:49:17 +0000 (+0200) Subject: Also show posts and replies that have the current Sone as post recipient. X-Git-Tag: 0.6.1^2~9 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e1da0315a8a0f46412332465ed95484f97ee6d7b;p=Sone.git Also show posts and replies that have the current Sone as post recipient. --- 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()); } });