diff options
author | Vitaly Takmazov | 2018-11-29 01:48:55 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-11-29 01:48:55 +0300 |
commit | af4ab437d158faec8db8c62bfd88c27dd4f59c8a (patch) | |
tree | 29e57a667a21c50aeccc35e6ad76c58f7474c64d /src | |
parent | d7f381dc53937f4b15156c51cb60feaeb745d0ef (diff) |
fix empty messages to PM
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/juick/server/XMPPConnection.java | 6 |
1 files changed, 4 insertions, 2 deletions
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) { |