diff options
author | Vitaly Takmazov | 2018-07-17 13:30:13 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-07-17 13:30:13 +0300 |
commit | 272a1af5b068a5585784f74e86dc277b32c691f3 (patch) | |
tree | 4de322832437e7c7d19b83ec8dedf07d2d87526b /juick-server/src/main/java/com/juick/server | |
parent | c601197c9da88ff1972c4621ffc982f67222bacc (diff) |
XMPP: route presences over XMPPRouter/babbler component
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/XMPPConnection.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java index 701a7d5b..78995e7a 100644 --- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java +++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java @@ -249,6 +249,9 @@ public class XMPPConnection implements StanzaListener, NotificationListener { logger.info("component connected"); } }); + router.addInboundPresenceListener(event -> { + incomingPresence(event.getPresence()); + }); service.submit(() -> { try { router.connect(); @@ -625,9 +628,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener { public void stanzaReceived(Stanza xmlValue) { if (xmlValue instanceof Presence) { Presence p = (Presence) xmlValue; - if (p.getType() == null || !p.getType().equals(Presence.Type.ERROR)) { - incomingPresence(p); - } + router.send(p); } else if (xmlValue instanceof Message) { Message msg = (Message) xmlValue; router.send(msg); |