From 7723b9fcfd8c41c47f7ae5890749306c1eeaac91 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 11 Feb 2013 17:22:31 +0000 Subject: [PATCH] ServiceDiscoveryManager: Anounce 'disco#info' and 'disco#items' on service discovery queries in accordance with XEP-0030 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13464 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smackx/ServiceDiscoveryManager.java | 4 ++++ source/org/jivesoftware/smackx/packet/DiscoverInfo.java | 4 +++- source/org/jivesoftware/smackx/packet/DiscoverItems.java | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java b/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java index 18da4bdcb..15d2f76ee 100644 --- a/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java +++ b/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java @@ -143,6 +143,10 @@ public class ServiceDiscoveryManager { private void init() { // Register the new instance and associate it with the connection instances.put(connection, this); + + addFeature(DiscoverInfo.NAMESPACE); + addFeature(DiscoverItems.NAMESPACE); + // Add a listener to the connection that removes the registered instance when // the connection is closed connection.addConnectionListener(new ConnectionListener() { diff --git a/source/org/jivesoftware/smackx/packet/DiscoverInfo.java b/source/org/jivesoftware/smackx/packet/DiscoverInfo.java index eeda1bfc8..4f4597d67 100644 --- a/source/org/jivesoftware/smackx/packet/DiscoverInfo.java +++ b/source/org/jivesoftware/smackx/packet/DiscoverInfo.java @@ -39,6 +39,8 @@ import java.util.concurrent.CopyOnWriteArrayList; */ public class DiscoverInfo extends IQ { + public static final String NAMESPACE = "http://jabber.org/protocol/disco#info"; + private final List features = new CopyOnWriteArrayList(); private final List identities = new CopyOnWriteArrayList(); private String node; @@ -133,7 +135,7 @@ public class DiscoverInfo extends IQ { public String getChildElementXML() { StringBuilder buf = new StringBuilder(); - buf.append(" items = new CopyOnWriteArrayList(); private String node; @@ -92,7 +94,7 @@ public class DiscoverItems extends IQ { public String getChildElementXML() { StringBuilder buf = new StringBuilder(); - buf.append("