Search code examples
xmppsmack

Smack API User search


I'm try to implement a user search on top of my working Smack-API based jabber client.It can create user using:

AccountManager manager = conn.getAccountManager();
manager.createAccount(usename,password);

However I need to add a functionality that will first search for "existing" user before it creates the account, but I can't find any straightforward way to do it. Anyone can provide me hints?

Thanks.


Solution

  • Apparently what's needed is just to catch the error code 409 in the XMPPException, as createAccount throws exception if user exist.