diff options
author | 2018-04-06 12:31:27 +0300 | |
---|---|---|
committer | 2018-04-06 12:31:27 +0300 | |
commit | 7fc4e305e546f30340b8b6a72426723163e91858 (patch) | |
tree | 5e69d617c7834214b8e82315a70cf85ba3111e08 /juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java | |
parent | d845327a561c46726fd9f06c9ead1c9fd8643ff4 (diff) |
server: trim xmpp commands
Diffstat (limited to 'juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java')
-rw-r--r-- | juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java | 6 |
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()); } |