X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetStatusAjaxPage.java;h=f107b7152d68592f2df366e4b654925d0aeccfa3;hp=384261c0f76cdc337da6e83c827cac508526606d;hb=8f02544d31f323ae9053dd9a11a99eacd8cf5bcd;hpb=4acdae8d247379dedcc5d41c8aded9503fcbaf72 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 384261c..f107b71 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -122,20 +122,14 @@ public class GetStatusAjaxPage extends JsonPage { }); } /* remove replies to unknown posts. */ - newReplies = Collections2.filter(newReplies, new Predicate() { - - @Override - public boolean apply(PostReply reply) { - return (reply.getPost() != null) && (reply.getPost().getSone() != null); - } - }); + newReplies = Collections2.filter(newReplies, PostReply.HAS_POST_FILTER); JsonArray jsonReplies = new JsonArray(); for (PostReply reply : newReplies) { JsonObject jsonReply = new JsonObject(); jsonReply.put("id", reply.getId()); jsonReply.put("sone", reply.getSone().getId()); - jsonReply.put("post", reply.getPost().getId()); - jsonReply.put("postSone", reply.getPost().getSone().getId()); + jsonReply.put("post", reply.getPostId()); + jsonReply.put("postSone", reply.getPost().get().getSone().getId()); jsonReplies.add(jsonReply); } return createSuccessJsonObject().put("loggedIn", currentSone != null).put("options", createJsonOptions(currentSone)).put("sones", jsonSones).put("notificationHash", notifications.hashCode()).put("newPosts", jsonPosts).put("newReplies", jsonReplies);