1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-11 01:59:38 +02:00

Fix isSupported discovery of "Push Notifications"

Fixes SMACK-780.
This commit is contained in:
Florian Schmaus 2017-10-14 14:12:28 +02:00
parent e1e12031ac
commit 0729392ab8
2 changed files with 55 additions and 0 deletions

View file

@ -87,13 +87,32 @@ public final class PushNotificationsManager extends Manager {
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @deprecated Use {@link #isSupported()} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.3
public boolean isSupportedByServer()
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return ServiceDiscoveryManager.getInstanceFor(connection())
.serverSupportsFeature(PushNotificationsElements.NAMESPACE);
}
/**
* Returns true if Push Notifications are supported by this account.
*
* @return true if Push Notifications are supported by this account.
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @since 4.2.2
*/
public boolean isSupported()
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return ServiceDiscoveryManager.getInstanceFor(connection()).accountSupportsFeatures(
PushNotificationsElements.NAMESPACE);
}
/**
* Enable push notifications.
*