diff options
Diffstat (limited to 'juick-server-xmpp/src/main/java/com/juick')
-rw-r--r-- | juick-server-xmpp/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/juick-server-xmpp/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java b/juick-server-xmpp/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java index a262e941..e70eb168 100644 --- a/juick-server-xmpp/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java +++ b/juick-server-xmpp/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java @@ -8,7 +8,11 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.xmlpull.v1.XmlPullParserException; import rocks.xmpp.addr.Jid; +import rocks.xmpp.core.stanza.model.IQ; +import rocks.xmpp.core.stanza.model.Message; import rocks.xmpp.core.stanza.model.Stanza; +import rocks.xmpp.core.stanza.model.server.ServerIQ; +import rocks.xmpp.core.stanza.model.server.ServerMessage; import rocks.xmpp.util.XmppUtils; import javax.annotation.PostConstruct; @@ -156,7 +160,14 @@ public class XMPPRouter implements StreamHandler { } @Override public void stanzaReceived(String stanza) { - sendOut(parse(stanza)); + Stanza input = parse(stanza); + if (input instanceof Message) { + sendOut(ServerMessage.from((Message)input)); + } else if (input instanceof IQ) { + sendOut(ServerIQ.from((IQ)input)); + } else { + logger.warn("unhandled stanza: {}", stanza); + } } @Override |