aboutsummaryrefslogtreecommitdiff
path: root/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-03 15:01:49 +0300
committerGravatar Vitaly Takmazov2018-04-03 15:01:49 +0300
commitc53675e5eb19a1a05ae5edcd0322075d51628b96 (patch)
tree62f98b6691c1f798978dfec0bd64f68948f18b4b /juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
parent3bfe060a796bd42c49a6510810fbe1cd0bbb8697 (diff)
xmpp: send reply notifications from event listener
Diffstat (limited to 'juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java')
-rw-r--r--juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java6
1 files changed, 4 insertions, 2 deletions
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));