Return IDs of Sone and recipient when getting new posts.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / GetStatusAjaxPage.java
index 015add5..effbebe 100644 (file)
@@ -91,7 +91,11 @@ public class GetStatusAjaxPage extends JsonPage {
                Set<Post> 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);
+                       jsonPosts.add(jsonPost);
                }
                /* load new replies. */
                Set<Reply> newReplies = webInterface.getNewReplies();