From: David ‘Bombe’ Roden Date: Fri, 12 Nov 2010 22:09:23 +0000 (+0100) Subject: Return the ID of the created reply. X-Git-Tag: 0.2.3~8 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6fdee5deb36fd25bf706b445f2315ea00480cddf;p=Sone.git Return the ID of the created reply. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java index 1d6dd86..c297bb3 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java @@ -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()); } }