[JDEV] "Username not available" error ...
Chris
cjbehm at mail.com
Wed Sep 20 19:25:35 CDT 2000
on 09/20/2000 08:02 PM, Jerome Banks at Jbanks at dicarta.com wrote:
>
> Folks ,
> I'm trying to write a client which checks to see if a user is registered
> with a jabber server, and if he isn't registered, automatically create
> an
> account on the jabberserver.
>
> The documentation in the Jabber Developer's guide for register .
>
> http://docs.jabber.org/jpg/refiqregister.html
>
> It implies that if one is already registered, there would be a
> <registered/> tag in the response. Instead I get Error 409,
> "Username not available". What am I supposed to do ???
>
> These interactions are too confusing as it is. There should be
> simpler ways to do these sorts of things ...
I'm not sure how much simpler that could be. You get a response, if the
error is 409 that means that someone is using that nick. If you send a
register message with something like a transport, you get the registered tag
back. The difference here is that if you are getting a registered, YOU are
the person that it is already registered to. If you get a 409 YOU don't
currently have an account. So you only create an account when you get a 409.
I should point out that this can be a 'dangerous' approach (auto-creating
accounts) if the user has to type in their account name. If you're going to
have it auto-create accounts then you need to have the user select an
account that was previously created from some sort of menu. Otherwise a wee
typo will turn into a new account which they think is the one they were
trying to get to.
At work we ran into something similar, but it was "easy" to solve since the
Jabber stuff is only a component so we don't even call the Jabber login
unless the other part of the account is valid. So auto-creating in that case
is always right.
Chris
More information about the JDev
mailing list