package net.pterodactylus.sone.fcp;
import static com.google.common.base.Optional.fromNullable;
-import static com.google.common.base.Optional.of;
import static net.pterodactylus.sone.data.Identified.GET_ID;
import net.pterodactylus.sone.core.Core;
super(core, true);
}
- /**
- * {@inheritDoc}
- */
@Override
public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
Sone sone = getSone(parameters, "Sone", true);
if (sone.equals(recipient)) {
return new ErrorResponse("Sone and Recipient must not be the same.");
}
- Post post = sone.newPostBuilder().to(fromNullable(recipient).transform(GET_ID)).withText(text).build(of(getCore().postCreated()));
+ Post post = sone.newPostBuilder().to(fromNullable(recipient).transform(GET_ID)).withText(text).build(getCore().postCreated());
return new Response("PostCreated", new SimpleFieldSetBuilder().put("Post", post.getId()).get());
}