From 6fdee5deb36fd25bf706b445f2315ea00480cddf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 12 Nov 2010 23:09:23 +0100 Subject: [PATCH] Return the ID of the created reply. --- .../java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()); } } -- 2.7.4