If no current Sone exists, return an error.
[Sone.git] / src / main / java / net / pterodactylus / sone / fcp / CreatePostCommand.java
index fcad23c..8ffba74 100644 (file)
@@ -46,16 +46,13 @@ public class CreatePostCommand 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");
                String text = getString(parameters, "Text");
                Sone recipient = null;
                if (parameters.get("Recipient") != null) {
-                       recipient = getSone(parameters, "Recipient", false);
+                       recipient = getMandatorySone(parameters, "Recipient");
                }
                if (sone.equals(recipient)) {
                        return new ErrorResponse("Sone and Recipient must not be the same.");