aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src')
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPBot.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/juick-server/src/main/java/com/juick/server/XMPPBot.java b/juick-server/src/main/java/com/juick/server/XMPPBot.java
index 6805b733..e2c6cfac 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPBot.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPBot.java
@@ -317,11 +317,9 @@ public class XMPPBot implements StanzaListener, NotificationListener {
@Override
public void processMessageEvent(MessageEvent event) {
com.juick.Message msg = event.getMessage();
- if (msg.getRid() == 0 && msg.getMid() > 0) {
- 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));
- } else if (msg.getTo() != null) {
+ boolean isPM = msg.getMid() == 0;
+ boolean isReply = msg.getRid() > 0;
+ if (isPM) {
userService.getJIDsbyUID(msg.getTo().getUid())
.forEach(userJid -> {
Message mm = new Message();
@@ -337,6 +335,10 @@ public class XMPPBot implements StanzaListener, NotificationListener {
}
xmpp.sendOut(ClientMessage.from(mm));
});
+ } else if (!isReply) {
+ 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));
}
}