X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FCreateReplyAjaxPage.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FCreateReplyAjaxPage.java;h=c297bb398e5c83679fb83e91b0fb7ed183205a0c;hb=6fdee5deb36fd25bf706b445f2315ea00480cddf;hp=1d6dd861ff256c9f42c07a57af90a6cca2824992;hpb=ba4d63c0da5bc1326073ccab87bff409291be571;p=Sone.git 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()); } }