Return IDs of Sone and recipient when getting new posts.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 13 Jan 2011 13:56:07 +0000 (14:56 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 13 Jan 2011 13:56:07 +0000 (14:56 +0100)
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
src/main/resources/static/javascript/sone.js

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();
index 2c3f742..c9521b7 100644 (file)
@@ -585,7 +585,7 @@ function getStatus() {
                        });
                        /* process new posts. */
                        $.each(data.newPosts, function(index, value) {
-                               loadNewPost(value);
+                               loadNewPost(value.id, value.sone, value.recipient);
                        });
                        /* process new replies. */
                        $.each(data.newReplies, function(index, value) {