1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 23:42:06 +01:00

AccountManager: Don't fallback to disco#info if not authenticated

This commit is contained in:
Florian Schmaus 2017-01-06 14:49:58 +01:00
parent 24bbe63da1
commit 7167a55f81

View file

@ -340,9 +340,15 @@ public final class AccountManager extends Manager {
return true; return true;
} }
// Fallback to disco#info only if this connection is authenticated, as otherwise we won't have an full JID and
// won't be able to do IQs.
if (connection.isAuthenticated()) {
return ServiceDiscoveryManager.getInstanceFor(connection).serverSupportsFeature(Registration.NAMESPACE); return ServiceDiscoveryManager.getInstanceFor(connection).serverSupportsFeature(Registration.NAMESPACE);
} }
return false;
}
/** /**
* Gets the account registration info from the server. * Gets the account registration info from the server.
* @throws XMPPErrorException * @throws XMPPErrorException