aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-12-31 02:40:05 +0300
committerGravatar Vitaly Takmazov2018-12-31 02:40:05 +0300
commit2273e26543e947bc9b227f7085187721ba2bfed4 (patch)
treef6d160c7d7a9d07de2756d33957ebe6c375a7e20 /src/main/java
parent71a4255c67a24dbbae0e283eab2d801fe0b848a4 (diff)
XMPP cleanup
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/juick/server/XMPPManager.java32
1 files changed, 1 insertions, 31 deletions
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<User> users) {
List<String> jids = new ArrayList<>();
@@ -321,7 +304,7 @@ public class XMPPManager implements NotificationListener {
}
}
- public void sendJuickComment(com.juick.Message jmsg, List<User> users) {
+ private void sendJuickComment(com.juick.Message jmsg, List<User> 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;
- }
}