From: David ‘Bombe’ Roden Date: Thu, 13 Jan 2011 13:56:07 +0000 (+0100) Subject: Return IDs of Sone and recipient when getting new posts. X-Git-Tag: 0.3.7^2~5^2~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2288fe8a74e888e9d6a8b13ccbd322ca006c1cec;p=Sone.git Return IDs of Sone and recipient when getting new posts. --- 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..effbebe 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -91,7 +91,11 @@ 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); + jsonPosts.add(jsonPost); } /* load new replies. */ Set newReplies = webInterface.getNewReplies(); diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 2c3f742..c9521b7 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -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) {