From 7fc4e305e546f30340b8b6a72426723163e91858 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 6 Apr 2018 12:31:27 +0300 Subject: server: trim xmpp commands --- .../src/main/java/com/juick/server/XMPPConnection.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'juick-server-xmpp/src/main/java/com/juick') 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()); } -- cgit v1.2.3