From 272a1af5b068a5585784f74e86dc277b32c691f3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 17 Jul 2018 13:30:13 +0300 Subject: XMPP: route presences over XMPPRouter/babbler component --- juick-server/src/main/java/com/juick/server/XMPPConnection.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'juick-server/src/main') 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); -- cgit v1.2.3