We need to implement following behaviour:
Client sends jabber:iq:register packet without username field.
Server creates new user and sends back result packet containing new username.
I’m reading http://www.xmpp.org/extensions/xep-0077.html, but I can’t understand if this behaviour is compliant with the standart. Anyone?
I don’t see anything in the XEP-0077: In-Band Registration that covers your needs. The server is not creating usernames and returning the created one to the client. It is always the client sending the username that he uses/needs. If you just need a random username then you can ask the client library to create a random name.
Thank you for your answer! But I mean that I need beaivour when server assigns usernames like 1@server, 2@server, etc. It must just increment the internal counter. Client doesn’t know it’s username before registration. All usernames go one after another. XEP-0077: In-Band Registration doesn’t say it is nessessary for a client to send username. And it doesn’t deny any additional info in the result packet. So imagine this:
<iq type='set' id='reg2'>
server creates new user 4@server and replies:
<iq type=‘result’ id=‘reg2’/> <query xmlns=‘jabber:iq:register’> <x xmlns=‘jabber:x:data’ type=‘result’> <field type=‘text-single’ label=‘username’ var=‘username’>
The question is if this is compliant to the standart. Thanks.