Remove replies to unknown posts from status.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 7 Jun 2011 12:42:18 +0000 (14:42 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 7 Jun 2011 12:42:18 +0000 (14:42 +0200)
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java

index 07fdfa8..246cbed 100644 (file)
@@ -127,6 +127,14 @@ public class GetStatusAjaxPage extends JsonPage {
 
                        });
                }
+               /* remove replies to unknown posts. */
+               newReplies = Filters.filteredSet(newReplies, new Filter<Reply>() {
+
+                       @Override
+                       public boolean filterObject(Reply reply) {
+                               return reply.getPost() != null;
+                       }
+               });
                JsonArray jsonReplies = new JsonArray();
                for (Reply reply : newReplies) {
                        JsonObject jsonReply = new JsonObject();