From 079752f16367c4d99e2dced2ffd06040ef3e4b44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 26 Nov 2010 20:17:06 +0100 Subject: [PATCH] Allow creation of posts with recipients using AJAX. --- src/main/java/net/pterodactylus/sone/web/ajax/CreatePostAjaxPage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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()); } -- 2.7.4