Skip to content

Commit

Permalink
[core] Make AccountManager.getRegistrationInfo() public
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stokito committed Aug 25, 2024
1 parent 854f847 commit c993187
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,17 @@ public boolean isSupported()
/**
* 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 {
Expand Down

0 comments on commit c993187

Please sign in to comment.