projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Actually delete the reply.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
fcp
/
CreatePostCommand.java
diff --git
a/src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java
b/src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java
index
01b52aa
..
8ffba74
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java
+++ b/
src/main/java/net/pterodactylus/sone/fcp/CreatePostCommand.java
@@
-18,7
+18,6
@@
package net.pterodactylus.sone.fcp;
import static com.google.common.base.Optional.fromNullable;
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;
import static net.pterodactylus.sone.data.Identified.GET_ID;
import net.pterodactylus.sone.core.Core;
@@
-47,21
+46,18
@@
public class CreatePostCommand extends AbstractSoneCommand {
super(core, true);
}
super(core, true);
}
- /**
- * {@inheritDoc}
- */
@Override
public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
@Override
public Response execute(SimpleFieldSet parameters, Bucket data, AccessType accessType) throws FcpException {
- Sone sone = get
Sone(parameters, "Sone", true
);
+ Sone sone = get
MandatoryLocalSone(parameters, "Sone"
);
String text = getString(parameters, "Text");
Sone recipient = null;
if (parameters.get("Recipient") != null) {
String text = getString(parameters, "Text");
Sone recipient = null;
if (parameters.get("Recipient") != null) {
- recipient = get
Sone(parameters, "Recipient", false
);
+ recipient = get
MandatorySone(parameters, "Recipient"
);
}
if (sone.equals(recipient)) {
return new ErrorResponse("Sone and Recipient must not be the same.");
}
}
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());
}
return new Response("PostCreated", new SimpleFieldSetBuilder().put("Post", post.getId()).get());
}