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
1 changed files with 7 additions and 1 deletions

View File

@ -340,7 +340,13 @@ public final class AccountManager extends Manager {
return true;
}
return ServiceDiscoveryManager.getInstanceFor(connection).serverSupportsFeature(Registration.NAMESPACE);
// 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 false;
}
/**