1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-10-18 20:25:59 +02:00

[core] Make AccountManager.getRegistrationInfo() public

The getRegistrationInfo() returns a registration form that may also contain a CAPTCHA.
We need to get the full Registration object to get the fields.
Also it should be possible to call it multiple times to update the form.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
This commit is contained in:
Sergey Ponomarev 2024-08-25 09:35:50 +02:00
parent 854f847db3
commit c99318783e

View file

@ -354,15 +354,17 @@ public final class AccountManager extends Manager {
/**
* Gets the account registration info from the server.
*
* @return Registration information
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
private synchronized void getRegistrationInfo() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
public synchronized Registration getRegistrationInfo() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Registration reg = new Registration();
reg.setTo(connection().getXMPPServiceDomain());
info = createStanzaCollectorAndSend(reg).nextResultOrThrow();
return info;
}
private StanzaCollector createStanzaCollectorAndSend(IQ req) throws NotConnectedException, InterruptedException {