/** * Returns true if the server supports creating new accounts. Many servers require * that you not be currently authenticated when creating new accounts, so the safest * behavior is to only create new accounts before having logged in to a server. * * @return true if the server support creating new accounts. */ public boolean supportsAccountCreation() { try { if (info == null) { getRegistrationInfo(); } return info.getType() != IQ.Type.ERROR; } catch (XMPPException xe) { return false; } }
/** * Returns true if the server supports creating new accounts. Many servers require * that you not be currently authenticated when creating new accounts, so the safest * behavior is to only create new accounts before having logged in to a server. * * @return true if the server support creating new accounts. */ public boolean supportsAccountCreation() { // Check if we already know that the server supports creating new accounts if (accountCreationSupported) { return true; } // No information is known yet (e.g. no stream feature was received from the server // indicating that it supports creating new accounts) so send an IQ packet as a way // to discover if this feature is supported try { if (info == null) { getRegistrationInfo(); accountCreationSupported = info.getType() != IQ.Type.ERROR; } return accountCreationSupported; } catch (XMPPException xe) { return false; } }
/** * Returns true if the server supports creating new accounts. Many servers require * that you not be currently authenticated when creating new accounts, so the safest * behavior is to only create new accounts before having logged in to a server. * * @return true if the server support creating new accounts. */ public boolean supportsAccountCreation() { // Check if we already know that the server supports creating new accounts if (accountCreationSupported) { return true; } // No information is known yet (e.g. no stream feature was received from the server // indicating that it supports creating new accounts) so send an IQ packet as a way // to discover if this feature is supported try { if (info == null) { getRegistrationInfo(); accountCreationSupported = info.getType() != IQ.Type.ERROR; } return accountCreationSupported; } catch (XMPPException xe) { return false; } }
/** * Returns true if the server supports creating new accounts. Many servers require * that you not be currently authenticated when creating new accounts, so the safest * behavior is to only create new accounts before having logged in to a server. * * @return true if the server support creating new accounts. */ public boolean supportsAccountCreation() { // Check if we already know that the server supports creating new accounts if (accountCreationSupported) { return true; } // No information is known yet (e.g. no stream feature was received from the server // indicating that it supports creating new accounts) so send an IQ packet as a way // to discover if this feature is supported try { if (info == null) { getRegistrationInfo(); accountCreationSupported = info.getType() != IQ.Type.ERROR; } return accountCreationSupported; } catch (XMPPException xe) { return false; } }