- Set<Reply> newReplies = webInterface.getNewReplies();
- JsonArray jsonReplies = new JsonArray();
- for (Reply reply : newReplies) {
- jsonReplies.add(reply.getId());
+ Collection<PostReply> newReplies = webInterface.getNewReplies(getCurrentSone(request.getToadletContext(), false));
+
+ ArrayNode jsonReplies = new ArrayNode(instance);
+ for (PostReply reply : newReplies) {
+ ObjectNode jsonReply = new ObjectNode(instance);
+ jsonReply.put("id", reply.getId());
+ jsonReply.put("sone", reply.getSone().getId());
+ jsonReply.put("post", reply.getPostId());
+ jsonReply.put("postSone", reply.getPost().get().getSone().getId());
+ jsonReplies.add(jsonReply);