X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FCreatePostAjaxPage.java;h=1e45a608814278980644bacf2d767022d061bdfb;hb=6db033602e7c17efc40a4a19efe705d67832fc1a;hp=0d553cc70daaf8181919700b4abf3228c286a8c0;hpb=7095e29ec66d04d9b466dd3ed762655ee334049e;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/CreatePostAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/CreatePostAjaxPage.java index 0d553cc..1e45a60 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/CreatePostAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/CreatePostAjaxPage.java @@ -36,7 +36,7 @@ public class CreatePostAjaxPage extends JsonPage { * The Sone web interface */ public CreatePostAjaxPage(WebInterface webInterface) { - super("ajax/createPost.ajax", webInterface); + super("createPost.ajax", webInterface); } /** @@ -48,11 +48,13 @@ public class CreatePostAjaxPage extends JsonPage { if (sone == null) { return createErrorJsonObject("auth-required"); } + String recipientId = request.getHttpRequest().getParam("recipient"); + Sone recipient = webInterface.getCore().getSone(recipientId, false); String text = request.getHttpRequest().getParam("text"); if ((text == null) || (text.trim().length() == 0)) { return createErrorJsonObject("text-required"); } - Post newPost = webInterface.getCore().createPost(sone, text); + Post newPost = webInterface.getCore().createPost(sone, recipient, text); return createSuccessJsonObject().put("postId", newPost.getId()); }