From 2273e26543e947bc9b227f7085187721ba2bfed4 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 31 Dec 2018 02:40:05 +0300 Subject: XMPP cleanup --- src/main/java/com/juick/server/XMPPManager.java | 32 +------------------------ 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/juick/server/XMPPManager.java b/src/main/java/com/juick/server/XMPPManager.java index fb8f9711..9b886784 100644 --- a/src/main/java/com/juick/server/XMPPManager.java +++ b/src/main/java/com/juick/server/XMPPManager.java @@ -189,13 +189,6 @@ public class XMPPManager implements NotificationListener { router.send(result); } }); - router.addInboundIQListener(e -> { - IQ iq = e.getIQ(); - Jid jid = iq.getTo(); - if (!jid.getDomain().equals(this.jid.getDomain())) { - router.send(iq); - } - }); FileTransferManager fileTransferManager = router.getManager(FileTransferManager.class); fileTransferManager.addFileTransferOfferListener(e -> { try { @@ -273,16 +266,6 @@ public class XMPPManager implements NotificationListener { serviceUser = userService.getUserByName(serviceUsername); } - private String stanzaToString(Stanza stanza) throws XMLStreamException, JAXBException { - StringWriter stanzaWriter = new StringWriter(); - XMLStreamWriter xmppStreamWriter = XmppUtils.createXmppStreamWriter( - router.getConfiguration().getXmlOutputFactory().createXMLStreamWriter(stanzaWriter)); - router.createMarshaller().marshal(stanza, xmppStreamWriter); - xmppStreamWriter.flush(); - xmppStreamWriter.close(); - return stanzaWriter.toString(); - } - private void sendJuickMessage(com.juick.Message jmsg, List users) { List jids = new ArrayList<>(); @@ -321,7 +304,7 @@ public class XMPPManager implements NotificationListener { } } - public void sendJuickComment(com.juick.Message jmsg, List users) { + private void sendJuickComment(com.juick.Message jmsg, List users) { String replyQuote; String replyTo; @@ -600,15 +583,6 @@ public class XMPPManager implements NotificationListener { } catch (Exception e1) { logger.warn("message exception", e1); } - } else if (to.getDomain().endsWith(jid.getDomain()) && (to.getDomain().equals(jid.getDomain()) - || to.getDomain().endsWith("." + jid.getDomain()))) { - if (logger.isInfoEnabled()) { - try { - logger.info("unhandled message: {}", stanzaToString(msg)); - } catch (JAXBException | XMLStreamException ex) { - logger.error("JAXB exception", ex); - } - } } else { return ClientMessage.from(msg); } @@ -671,8 +645,4 @@ public class XMPPManager implements NotificationListener { router.close(); } } - - public ExternalComponent getRouter() { - return router; - } } -- cgit v1.2.3