X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FCreateReplyCommand.java;h=4a5323864ae8d66a0606dd58a5973f7632f24996;hb=c4eb31ab64627adfdeed2a445d67883371203e99;hp=9fc78d602cca80e3d7345867c12a141ee9d3ecc9;hpb=43a21f859e9fec31096c1540148bdd44a8e3702f;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 9fc78d6..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 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()); }