mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 22:32:06 +01:00
Add ServiceDiscoveryManager.serverSupportsFeature()
This commit is contained in:
parent
b71039660b
commit
98c69f6895
4 changed files with 18 additions and 5 deletions
|
@ -104,8 +104,7 @@ public class CarbonManager extends Manager {
|
||||||
* @throws NoResponseException
|
* @throws NoResponseException
|
||||||
*/
|
*/
|
||||||
public boolean isSupportedByServer() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
public boolean isSupportedByServer() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||||
return ServiceDiscoveryManager.getInstanceFor(connection()).supportsFeature(
|
return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(CarbonExtension.NAMESPACE);
|
||||||
connection().getServiceName(), CarbonExtension.NAMESPACE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -637,6 +637,21 @@ public class ServiceDiscoveryManager extends Manager {
|
||||||
connection().createPacketCollectorAndSend(discoverItems).nextResultOrThrow();
|
connection().createPacketCollectorAndSend(discoverItems).nextResultOrThrow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the server supports the given feature.
|
||||||
|
*
|
||||||
|
* @param feature
|
||||||
|
* @return true if the server supports the given feature.
|
||||||
|
* @throws NoResponseException
|
||||||
|
* @throws XMPPErrorException
|
||||||
|
* @throws NotConnectedException
|
||||||
|
* @since 4.1
|
||||||
|
*/
|
||||||
|
public boolean serverSupportsFeature(String feature) throws NoResponseException, XMPPErrorException,
|
||||||
|
NotConnectedException {
|
||||||
|
return supportsFeature(connection().getServiceName(), feature);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries the remote entity for it's features and returns true if the given feature is found.
|
* Queries the remote entity for it's features and returns true if the given feature is found.
|
||||||
*
|
*
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class OfflineMessageManager {
|
||||||
* @throws NotConnectedException
|
* @throws NotConnectedException
|
||||||
*/
|
*/
|
||||||
public boolean supportsFlexibleRetrieval() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
public boolean supportsFlexibleRetrieval() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||||
return ServiceDiscoveryManager.getInstanceFor(connection).supportsFeature(connection.getServiceName(), namespace);
|
return ServiceDiscoveryManager.getInstanceFor(connection).serverSupportsFeature(namespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -547,7 +547,6 @@ public class PrivacyListManager extends Manager {
|
||||||
* @throws NotConnectedException
|
* @throws NotConnectedException
|
||||||
*/
|
*/
|
||||||
public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException{
|
public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException{
|
||||||
return ServiceDiscoveryManager.getInstanceFor(connection()).supportsFeature(
|
return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(NAMESPACE);
|
||||||
connection().getServiceName(), NAMESPACE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue