From c53675e5eb19a1a05ae5edcd0322075d51628b96 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 3 Apr 2018 15:01:49 +0300 Subject: xmpp: send reply notifications from event listener --- .../src/main/java/com/juick/server/XMPPConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-server-xmpp') 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 3538077a..04c3e2ab 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 @@ -191,7 +191,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener { if (jmsg.getRid() > 0) { // to get quote and attachment com.juick.Message reply = messagesService.getReply(jmsg.getMid(), jmsg.getRid()); - sendJuickComment(reply); applicationEventPublisher.publishEvent(new MessageEvent(this, reply)); } else if (jmsg.getMid() > 0) { sendJuickMessage(jmsg); @@ -412,7 +411,10 @@ public class XMPPConnection implements StanzaListener, NotificationListener { } s2s(ClientMessage.from(mm)); }); - } else if (!isReply) { + } else if (isReply) { + sendJuickComment(msg); + } + else { String notify = "New message posted.\n#" + msg.getMid() + " https://juick.com/" + msg.getMid(); userService.getJIDsbyUID(msg.getUser().getUid()) .forEach(jid -> sendReply(Jid.of(jid), notify)); -- cgit v1.2.3