mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01: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:
parent
854f847db3
commit
c99318783e
1 changed files with 3 additions and 1 deletions
|
@ -354,15 +354,17 @@ public final class AccountManager extends Manager {
|
||||||
/**
|
/**
|
||||||
* Gets the account registration info from the server.
|
* Gets the account registration info from the server.
|
||||||
*
|
*
|
||||||
|
* @return Registration information
|
||||||
* @throws XMPPErrorException if there was an XMPP error returned.
|
* @throws XMPPErrorException if there was an XMPP error returned.
|
||||||
* @throws NoResponseException if there was no response from the remote entity.
|
* @throws NoResponseException if there was no response from the remote entity.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @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();
|
Registration reg = new Registration();
|
||||||
reg.setTo(connection().getXMPPServiceDomain());
|
reg.setTo(connection().getXMPPServiceDomain());
|
||||||
info = createStanzaCollectorAndSend(reg).nextResultOrThrow();
|
info = createStanzaCollectorAndSend(reg).nextResultOrThrow();
|
||||||
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
private StanzaCollector createStanzaCollectorAndSend(IQ req) throws NotConnectedException, InterruptedException {
|
private StanzaCollector createStanzaCollectorAndSend(IQ req) throws NotConnectedException, InterruptedException {
|
||||||
|
|
Loading…
Reference in a new issue