From: David ‘Bombe’ Roden Date: Fri, 26 Nov 2010 19:17:06 +0000 (+0100) Subject: Allow creation of posts with recipients using AJAX. X-Git-Tag: 0.3.2-RC1~15^2~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=079752f16367c4d99e2dced2ffd06040ef3e4b44;p=Sone.git Allow creation of posts with recipients using AJAX. --- 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..ce2462c 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/CreatePostAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/CreatePostAjaxPage.java @@ -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()); }