1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 05:22:06 +01:00

Merge pull request #618 from stokito/account_registration

[core] Make AccountManager.getRegistrationInfo() public
This commit is contained in:
Florian Schmaus 2024-09-14 10:10:57 +00:00 committed by GitHub
commit af77e561c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {