X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetStatusAjaxPage.java;h=a358fb1df4fa65b9eed1b0068bdaecfb94c1611b;hb=3ea1ec9e8259fe2808fcaadcf7db2e22fd81ad2b;hp=015add553879b7f39889a05510dbac4f6280282a;hpb=7815943b9ecc1199e11dd8be9736d6f3e892118e;p=Sone.git 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 015add5..a358fb1 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -91,13 +91,23 @@ public class GetStatusAjaxPage extends JsonPage { Set newPosts = webInterface.getNewPosts(); JsonArray jsonPosts = new JsonArray(); for (Post post : newPosts) { - jsonPosts.add(post.getId()); + JsonObject jsonPost = new JsonObject(); + jsonPost.put("id", post.getId()); + jsonPost.put("sone", post.getSone().getId()); + jsonPost.put("recipient", (post.getRecipient() != null) ? post.getRecipient().getId() : null); + jsonPost.put("time", post.getTime()); + jsonPosts.add(jsonPost); } /* load new replies. */ Set newReplies = webInterface.getNewReplies(); JsonArray jsonReplies = new JsonArray(); for (Reply reply : newReplies) { - jsonReplies.add(reply.getId()); + 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()); + jsonReplies.add(jsonReply); } return createSuccessJsonObject().put("sones", jsonSones).put("notifications", jsonNotifications).put("removedNotifications", jsonRemovedNotifications).put("newPosts", jsonPosts).put("newReplies", jsonReplies); }