Return recipient of a post in JSON post.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / GetPostAjaxPage.java
index 452fc5a..7c96d56 100644 (file)
@@ -46,7 +46,7 @@ public class GetPostAjaxPage extends JsonPage {
         *            The template to render for posts
         */
        public GetPostAjaxPage(WebInterface webInterface, Template postTemplate) {
-               super("ajax/getPost.ajax", webInterface);
+               super("getPost.ajax", webInterface);
                this.postTemplate = postTemplate;
        }
 
@@ -88,6 +88,7 @@ public class GetPostAjaxPage extends JsonPage {
                JsonObject jsonPost = new JsonObject();
                jsonPost.put("id", post.getId());
                jsonPost.put("sone", post.getSone().getId());
+               jsonPost.put("recipient", (post.getRecipient() == null) ? null : post.getRecipient().getId());
                jsonPost.put("time", post.getTime());
                postTemplate.set("post", post);
                StringWriter stringWriter = new StringWriter();