aboutsummaryrefslogtreecommitdiff
path: root/juick-server-xmpp/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-06 12:31:27 +0300
committerGravatar Vitaly Takmazov2018-04-06 12:31:27 +0300
commit7fc4e305e546f30340b8b6a72426723163e91858 (patch)
tree5e69d617c7834214b8e82315a70cf85ba3111e08 /juick-server-xmpp/src
parentd845327a561c46726fd9f06c9ead1c9fd8643ff4 (diff)
server: trim xmpp commands
Diffstat (limited to 'juick-server-xmpp/src')
-rw-r--r--juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java b/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
index 7ea11216..2bdec0a7 100644
--- a/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
+++ b/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
@@ -588,7 +588,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
if (oobX != null) {
attachmentURI = oobX.getUri();
}
- incomingMessageJuick(user_from, msg.getFrom(), msg.getBody(), attachmentURI);
+ incomingMessageJuick(user_from, msg.getFrom(), StringUtils.defaultString(msg.getBody()), attachmentURI);
}
private void incomingMessageJuick(User user_from, Jid from, String command, @Nonnull URI attachment)
throws Exception {
@@ -600,10 +600,10 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
// COMPATIBILITY
if (commandlen > 7 && command.substring(0, 3).equalsIgnoreCase("PM ")) {
- command = command.substring(3).trim();
+ command = command.substring(3);
}
- CommandResult result = commandsManager.processCommand(user_from, from, command, attachment);
+ CommandResult result = commandsManager.processCommand(user_from, from, command.trim(), attachment);
if (StringUtils.isNotBlank(result.getText())) {
sendReply(from, result.getText());
}