From 71c29cc99d1b3f71247b81bc42d30f8b52dad240 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 4 Apr 2018 22:20:52 +0300 Subject: server: PMs in email * also introduces MessageUtils.isReply and MessageUtils.isPM --- .../src/main/java/com/juick/server/XMPPConnection.java | 6 ++---- 1 file changed, 2 insertions(+), 4 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 f0c205d9..19fddd78 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 @@ -391,9 +391,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener { @Override public void processMessageEvent(MessageEvent event) { com.juick.Message msg = event.getMessage(); - boolean isPM = msg.getMid() == 0; - boolean isReply = msg.getRid() > 0; - if (isPM) { + if (MessageUtils.isPM(msg)) { userService.getJIDsbyUID(msg.getTo().getUid()) .forEach(userJid -> { Message mm = new Message(); @@ -409,7 +407,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener { } router.send(ClientMessage.from(mm)); }); - } else if (isReply) { + } else if (MessageUtils.isReply(msg)) { sendJuickComment(msg); } else { -- cgit v1.2.3