X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FCreatePostCommand.java;h=cd596ce3a7563def46c3dba3283affe2fc223531;hp=a37dc46bbe82de76daa8a999bbf8c228a04648de;hb=419098bcd6215125408b29e60bd888e60979d37b;hpb=a47643aed43d118ca68044f95451bb5374cdb332 diff --git a/src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java b/src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java index a37dc46..cd596ce 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java @@ -1,5 +1,5 @@ /* - * Sone - CreatePostCommand.java - Copyright © 2011–2012 David Roden + * Sone - CreatePostCommand.java - Copyright © 2011–2015 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,8 @@ package net.pterodactylus.sone.fcp; +import com.google.common.base.Optional; + import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.Sone; @@ -57,7 +59,7 @@ public class CreatePostCommand extends AbstractSoneCommand { if (sone.equals(recipient)) { return new ErrorResponse("Sone and Recipient must not be the same."); } - Post post = getCore().createPost(sone, recipient, text); + Post post = getCore().createPost(sone, Optional.fromNullable(recipient), text); return new Response("PostCreated", new SimpleFieldSetBuilder().put("Post", post.getId()).get()); }