X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FCreateReplyCommand.java;h=4a5323864ae8d66a0606dd58a5973f7632f24996;hb=959c51e271d7da6566ecd13b912ede0d5e627b3d;hp=84bedc7515f56a676eb2a22b28dea088d1c325a8;hpb=480691a26222e035e53bda56029524e160fdf898;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/fcp/CreateReplyCommand.java b/src/main/java/net/pterodactylus/sone/fcp/CreateReplyCommand.java index 84bedc7..4a53238 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/CreateReplyCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/CreateReplyCommand.java @@ -1,5 +1,5 @@ /* - * Sone - CreateReplyCommand.java - Copyright © 2011–2012 David Roden + * Sone - CreateReplyCommand.java - Copyright © 2011–2013 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 @@ -45,15 +45,12 @@ public class CreateReplyCommand extends AbstractSoneCommand { super(core, true); } - /** - * {@inheritDoc} - */ @Override public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException { - Sone sone = getSone(parameters, "Sone", true); + Sone sone = getMandatoryLocalSone(parameters, "Sone"); Post post = getPost(parameters, "Post"); String text = getString(parameters, "Text"); - PostReply reply = getCore().createReply(sone, post, text); + PostReply reply = sone.newPostReplyBuilder(post.getId()).withText(text).build(getCore().postReplyCreated()); return new Response("ReplyCreated", new SimpleFieldSetBuilder().put("Reply", reply.getId()).get()); }