*
* @param sone
* The Sone that creates the post
- * @param text
- * The text of the post
- * @return The created post
- */
- public Post createPost(Sone sone, String text) {
- return createPost(sone, System.currentTimeMillis(), text);
- }
-
- /**
- * Creates a new post.
- *
- * @param sone
- * The Sone that creates the post
- * @param time
- * The time of the post
- * @param text
- * The text of the post
- * @return The created post
- */
- public Post createPost(Sone sone, long time, String text) {
- return createPost(sone, null, time, text);
- }
-
- /**
- * Creates a new post.
- *
- * @param sone
- * The Sone that creates the post
- * @param recipient
- * The recipient Sone, or {@code null} if this post does not have
- * a recipient
- * @param text
- * The text of the post
- * @return The created post
- */
- public Post createPost(Sone sone, Sone recipient, String text) {
- return createPost(sone, recipient, System.currentTimeMillis(), text);
- }
-
- /**
- * Creates a new post.
- *
- * @param sone
- * The Sone that creates the post
* @param recipient
* The recipient Sone, or {@code null} if this post does not have
* a recipient
/**
* FCP command that creates a new {@link Post}.
*
- * @see Core#createPost(Sone, Sone, String)
+ * @see Core#createPost(Sone, Sone, long, String)
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
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, recipient, System.currentTimeMillis(), text);
return new Response("PostCreated", new SimpleFieldSetBuilder().put("Post", post.getId()).get());
}
return createErrorJsonObject("text-required");
}
text = TextFilter.filter(request.getHttpRequest().getHeader("host"), text);
- Post newPost = webInterface.getCore().createPost(sender, recipient, text);
+ Post newPost = webInterface.getCore().createPost(sender, recipient, System.currentTimeMillis(), text);
return createSuccessJsonObject().put("postId", newPost.getId()).put("sone", sender.getId()).put("recipient", (newPost.getRecipient() != null) ? newPost.getRecipient().getId() : null);
}