1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

Merge branch '4.2'

This commit is contained in:
Florian Schmaus 2017-10-14 14:56:36 +02:00
commit 384c285fbc
20 changed files with 303 additions and 79 deletions

View file

@ -52,6 +52,7 @@ import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.Jid;
import org.jxmpp.util.cache.Cache;
import org.jxmpp.util.cache.ExpirationCache;
@ -680,6 +681,41 @@ public final class ServiceDiscoveryManager extends Manager {
return supportsFeatures(connection().getXMPPServiceDomain(), features);
}
/**
* Check if the given features are supported by the connection account. This means that the discovery information
* lookup will be performed on the bare JID of the connection managed by this ServiceDiscoveryManager.
*
* @param features the features to check
* @return <code>true</code> if all features are supported by the connection account, <code>false</code> otherwise
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @since 4.2.2
*/
public boolean accountSupportsFeatures(CharSequence... features)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return accountSupportsFeatures(Arrays.asList(features));
}
/**
* Check if the given collection of features are supported by the connection account. This means that the discovery
* information lookup will be performed on the bare JID of the connection managed by this ServiceDiscoveryManager.
*
* @param features a collection of features
* @return <code>true</code> if all features are supported by the connection account, <code>false</code> otherwise
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @since 4.2.2
*/
public boolean accountSupportsFeatures(Collection<? extends CharSequence> features)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
EntityBareJid accountJid = connection().getUser().asEntityBareJid();
return supportsFeatures(accountJid, features);
}
/**
* Queries the remote entity for it's features and returns true if the given feature is found.
*