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?
Hey Vladislav,
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.
Regards,
– Gato
Hi Dombiak,
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:
client sends:
<iq type='set' id='reg2'>
<query xmlns='jabber:iq:register'>
<name>Bill Auost</name>
<password>Calliope</password>
<email>bard@shakespeare.lit</email> </query>
</iq>
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’>
<value>4</value>
</field>
</x>
</query>
</iq>
The question is if this is compliant to the standart. Thanks.