X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreatePostPage.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreatePostPage.java;h=a8e2128e8e69e22439c8f2e117e63e5d0887196e;hp=10a8c7a757ca92f2f13c93f52260166e1abb75de;hb=d10ab65fa3021a182b7d2e638d70df9f0ad69c4c;hpb=079752f16367c4d99e2dced2ffd06040ef3e4b44 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);