aboutsummaryrefslogtreecommitdiff
path: root/juick-server-xmpp/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-02 19:58:06 +0300
committerGravatar Vitaly Takmazov2018-04-02 19:58:13 +0300
commit2e5ba5e7462d6684433ea638c9ff8f95c864be74 (patch)
treee3292acb7238893c2c8abf2f6a02e3c518a66d18 /juick-server-xmpp/src/main
parent23afae3ee573dd72ed5c58a2e013dcf307829c66 (diff)
xmpp: fix router namespace
Diffstat (limited to 'juick-server-xmpp/src/main')
-rw-r--r--juick-server-xmpp/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java13
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