From a198dd3bc51796a5a1caa2407c83a725e3deaba8 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 30 Jul 2018 13:17:37 +0300 Subject: xmpp: add client/bot identity --- juick-server/src/main/java/com/juick/server/XMPPConnection.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-server/src/main/java') diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java index 12e66d40..41102322 100644 --- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java +++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java @@ -46,6 +46,8 @@ import rocks.xmpp.core.stanza.model.client.ClientPresence; import rocks.xmpp.core.stanza.model.errors.Condition; import rocks.xmpp.extensions.caps.EntityCapabilitiesManager; import rocks.xmpp.extensions.component.accept.ExternalComponent; +import rocks.xmpp.extensions.disco.ServiceDiscoveryManager; +import rocks.xmpp.extensions.disco.model.info.Identity; import rocks.xmpp.extensions.filetransfer.FileTransfer; import rocks.xmpp.extensions.filetransfer.FileTransferManager; import rocks.xmpp.extensions.nick.model.Nickname; @@ -126,6 +128,8 @@ public class XMPPConnection implements StanzaListener, NotificationListener { logger.info("stream router start connecting to {}", componentPort); xmpp.addStanzaListener(this); router = ExternalComponent.create(componentName, password, session.getConfiguration(), "localhost", componentPort); + ServiceDiscoveryManager serviceDiscoveryManager = router.getManager(ServiceDiscoveryManager.class); + serviceDiscoveryManager.addIdentity(Identity.clientBot().withName("Juick")); EntityCapabilitiesManager entityCapabilitiesManager = router.getManager(EntityCapabilitiesManager.class); entityCapabilitiesManager.setNode("https://juick.com/caps"); MessageDeliveryReceiptsManager messageDeliveryReceiptsManager = router.getManager(MessageDeliveryReceiptsManager.class); -- cgit v1.2.3