From 37fa69d19152202384308c5b368943ad1348c74b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 6 Feb 2017 19:17:26 +0300 Subject: juick-xmpp: fix message routing --- .../src/main/java/com/juick/components/XMPPConnection.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java b/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java index a082c4cb..a3c30964 100644 --- a/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java +++ b/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java @@ -7,6 +7,7 @@ import rocks.xmpp.addr.Jid; import rocks.xmpp.core.XmppException; import rocks.xmpp.core.stanza.model.Message; import rocks.xmpp.core.stanza.model.Stanza; +import rocks.xmpp.core.stanza.model.client.ClientMessage; import rocks.xmpp.extensions.component.accept.ExternalComponent; import rocks.xmpp.extensions.nick.model.Nickname; import rocks.xmpp.extensions.oob.model.x.OobX; @@ -61,7 +62,7 @@ public class XMPPConnection implements AutoCloseable { } } } else { - route(jid.getDomain(), message); + route(jid.getDomain(), ClientMessage.from(message)); } }); try { @@ -140,7 +141,7 @@ public class XMPPConnection implements AutoCloseable { for (String jid : jids) { msg.setTo(Jid.of(jid)); - route(msg.getTo().getDomain(), msg); + route(msg.getTo().getDomain(), ClientMessage.from(msg)); } } @@ -171,7 +172,7 @@ public class XMPPConnection implements AutoCloseable { for (User user : users) { for (String jid : xmpp.userService.getJIDsbyUID(user.getUid())) { msg.setTo(Jid.of(jid)); - route(msg.getTo().getDomain(), msg); + route(msg.getTo().getDomain(), ClientMessage.from(msg)); } } } @@ -220,7 +221,7 @@ public class XMPPConnection implements AutoCloseable { for (User user : users) { for (String jid : xmpp.userService.getJIDsbyUID(user.getUid())) { msg.setTo(Jid.of(jid)); - route(msg.getTo().getDomain(), msg); + route(msg.getTo().getDomain(), ClientMessage.from(msg)); } } } -- cgit v1.2.3