Return the ID of the created reply.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 12 Nov 2010 22:09:23 +0000 (23:09 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 12 Nov 2010 22:09:23 +0000 (23:09 +0100)
src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java

index 1d6dd86..c297bb3 100644 (file)
@@ -18,6 +18,7 @@
 package net.pterodactylus.sone.web.ajax;
 
 import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.data.Reply;
 import net.pterodactylus.sone.data.Sone;
 import net.pterodactylus.sone.web.WebInterface;
 import net.pterodactylus.util.json.JsonObject;
@@ -58,8 +59,8 @@ public class CreateReplyAjaxPage extends JsonPage {
                if ((post == null) || (post.getSone() == null)) {
                        return new JsonObject().put("success", false).put("error", "invalid-post-id");
                }
-               webInterface.getCore().createReply(currentSone, post, text);
-               return new JsonObject().put("success", true);
+               Reply reply = webInterface.getCore().createReply(currentSone, post, text);
+               return new JsonObject().put("success", true).put("reply", reply.getId());
        }
 
 }