From af4ab437d158faec8db8c62bfd88c27dd4f59c8a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 29 Nov 2018 01:48:55 +0300 Subject: fix empty messages to PM --- src/main/java/com/juick/server/XMPPConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/juick/server/XMPPConnection.java b/src/main/java/com/juick/server/XMPPConnection.java index 01cbd32b..979ba1fd 100644 --- a/src/main/java/com/juick/server/XMPPConnection.java +++ b/src/main/java/com/juick/server/XMPPConnection.java @@ -598,8 +598,10 @@ public class XMPPConnection implements StanzaListener, NotificationListener { return incomingMessageJuick(user_from, msg.getFrom(), StringUtils.defaultString(msg.getBody()), attachment); } else { // PM - result = incomingMessageJuick(user_from, msg.getFrom(), - String.format("@%s %s", msg.getTo().getLocal(), StringUtils.defaultString(msg.getBody())), attachment); + if (!StringUtils.isEmpty(msg.getBody())) { + result = incomingMessageJuick(user_from, msg.getFrom(), + String.format("@%s %s", msg.getTo().getLocal(), StringUtils.defaultString(msg.getBody())), attachment); + } } messagesService.getUnread(user_from).forEach(mid -> messagesService.setRead(user_from, mid)); } catch (Exception e1) { -- cgit v1.2.3