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();
});
/* 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) {