From 5fb17dc85f3c3a1745bfe41a65c4ec4dde03779f Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Fri, 31 Oct 2014 18:01:42 +0100 Subject: [PATCH] Use ServiceDiscoveryManager.supportsFeature() in AMPManager --- .../java/org/jivesoftware/smackx/amp/AMPManager.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/amp/AMPManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/amp/AMPManager.java index bfd169295..acd97e48b 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/amp/AMPManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/amp/AMPManager.java @@ -24,7 +24,6 @@ import org.jivesoftware.smack.XMPPConnectionRegistry; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smackx.amp.packet.AMPExtension; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; -import org.jivesoftware.smackx.disco.packet.DiscoverInfo; /** * Manages AMP stanzas within messages. A AMPManager provides a high level access to @@ -111,13 +110,6 @@ public class AMPManager { } private static boolean isFeatureSupportedByServer(XMPPConnection connection, String featureName, String node) throws NoResponseException, XMPPErrorException, NotConnectedException { - ServiceDiscoveryManager discoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); - DiscoverInfo info = discoveryManager.discoverInfo(connection.getServiceName(), node); - for (DiscoverInfo.Feature feature : info.getFeatures()){ - if (featureName.equals(feature.getVar())) { - return true; - } - } - return false; + return ServiceDiscoveryManager.getInstanceFor(connection).supportsFeature(node, featureName); } }