From: David ‘Bombe’ Roden Date: Fri, 26 Nov 2010 19:19:20 +0000 (+0100) Subject: Allow creation of post with recipient using HTTP POST. X-Git-Tag: 0.3.2-RC1~15^2~5 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d10ab65fa3021a182b7d2e638d70df9f0ad69c4c;p=Sone.git Allow creation of post with recipient using HTTP POST. --- diff --git a/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java b/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java index 10a8c7a..a8e2128 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java @@ -55,8 +55,10 @@ public class CreatePostPage extends SoneTemplatePage { if (request.getMethod() == Method.POST) { String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim(); if (text.length() != 0) { + String recipientId = request.getHttpRequest().getPartAsStringFailsafe("recipient", 43); + Sone recipient = webInterface.getCore().getSone(recipientId, false); Sone currentSone = getCurrentSone(request.getToadletContext()); - webInterface.getCore().createPost(currentSone, System.currentTimeMillis(), text); + webInterface.getCore().createPost(currentSone, recipient, System.currentTimeMillis(), text); throw new RedirectException(returnPage); } template.set("errorTextEmpty", true);