1 # MUC: Room registration and reserved nicknames
20 <presence to="room@conference.localhost/Romeo">
21 <x xmlns="http://jabber.org/protocol/muc"/>
25 <presence from='room@conference.localhost/Romeo'>
26 <x xmlns='http://jabber.org/protocol/muc#user'>
28 <item jid="${Romeo's full JID}" affiliation='owner' role='moderator'/>
34 <message type='groupchat' from='room@conference.localhost'><subject/></message>
38 <iq id='config1' to='room@conference.localhost' type='set'>
39 <query xmlns='http://jabber.org/protocol/muc#owner'>
40 <x xmlns='jabber:x:data' type='submit'>
41 <field var='FORM_TYPE'>
42 <value>http://jabber.org/protocol/muc#roomconfig</value>
49 <iq id="config1" from="room@conference.localhost" type="result">
53 <iq id='member1' to='room@conference.localhost' type='set'>
54 <query xmlns='http://jabber.org/protocol/muc#admin'>
55 <item affiliation='member' jid="${Juliet's JID}" />
60 <message from='room@conference.localhost'>
61 <x xmlns='http://jabber.org/protocol/muc#user'>
62 <item jid="${Juliet's JID}" affiliation='member' />
67 <iq from='room@conference.localhost' id='member1' type='result'/>
69 # Juliet connects, and joins the room
73 <presence to="room@conference.localhost/Juliet">
74 <x xmlns="http://jabber.org/protocol/muc"/>
78 <presence from="room@conference.localhost/Romeo" />
81 <presence from="room@conference.localhost/Juliet" />
84 <message type='groupchat' from='room@conference.localhost'><subject/></message>
87 <presence from="room@conference.localhost/Juliet" />
89 # Juliet retrieves the registration form
92 <iq id='jw81b36f' to='room@conference.localhost' type='get'>
93 <query xmlns='jabber:iq:register'/>
97 <iq type='result' from='room@conference.localhost' id='jw81b36f'>
98 <query xmlns='jabber:iq:register'>
99 <x type='form' xmlns='jabber:x:data'>
100 <field type='hidden' var='FORM_TYPE'>
101 <value>http://jabber.org/protocol/muc#register</value>
103 <field type='text-single' label='Nickname' var='muc#register_roomnick'/>
109 <iq id='nv71va54' to='room@conference.localhost' type='set'>
110 <query xmlns='jabber:iq:register'>
111 <x xmlns='jabber:x:data' type='submit'>
112 <field var='FORM_TYPE'>
113 <value>http://jabber.org/protocol/muc#register</value>
115 <field var='muc#register_roomnick'>
116 <value>Juliet</value>
123 <presence from='room@conference.localhost/Juliet'>
124 <x xmlns='http://jabber.org/protocol/muc#user'>
125 <item affiliation='member' jid="${Juliet's full JID}" role='participant'/>
131 <iq type='result' from='room@conference.localhost' id='nv71va54'/>
133 # Juliet discovers her reserved nick
136 <iq id='getnick1' to='room@conference.localhost' type='get'>
137 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/>
141 <iq type='result' from='room@conference.localhost' id='getnick1'>
142 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'>
143 <identity category='conference' name='Juliet' type='text'/>
147 # Juliet leaves the room:
150 <presence type="unavailable" to="room@conference.localhost/Juliet" />
153 <presence type='unavailable' from='room@conference.localhost/Juliet'>
154 <x xmlns='http://jabber.org/protocol/muc#user'>
155 <item jid="${Juliet's full JID}" affiliation='member' role='none'/>
161 <presence from='room@conference.localhost/Juliet'>
162 <x xmlns='http://jabber.org/protocol/muc#user'>
163 <item jid="${Juliet's full JID}" affiliation='member' role='participant'/>
167 # Rosaline connect and tries to join the room as Juliet
172 <presence to="room@conference.localhost/Juliet">
173 <x xmlns="http://jabber.org/protocol/muc"/>
177 <presence type='error' from='room@conference.localhost/Juliet'>
178 <error type='cancel'>
179 <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
181 <x xmlns='http://jabber.org/protocol/muc'/>
184 # In a heated moment, Juliet unregisters from the room
187 <iq type='set' to='room@conference.localhost' id='unreg1'>
188 <query xmlns='jabber:iq:register'>
194 <iq type='result' from='room@conference.localhost' id='unreg1'/>
196 # Romeo is notified of Juliet's sad decision
199 <message from='room@conference.localhost'>
200 <x xmlns='http://jabber.org/protocol/muc#user' scansion:strict='true'>
201 <item jid="${Juliet's JID}" />
205 # Rosaline attempts once more to sneak into the room, disguised as Juliet
208 <presence to="room@conference.localhost/Juliet">
209 <x xmlns="http://jabber.org/protocol/muc"/>
213 <presence from='room@conference.localhost/Romeo'>
214 <x xmlns='http://jabber.org/protocol/muc#user'>
215 <item affiliation='owner' role='moderator'/>
220 <presence from='room@conference.localhost/Juliet'>
221 <x xmlns='http://jabber.org/protocol/muc#user'>
222 <item affiliation='none' jid="${Rosaline's full JID}" role='participant'/>
228 <presence from='room@conference.localhost/Juliet'>
229 <x xmlns='http://jabber.org/protocol/muc#user'>
230 <item affiliation='none' jid="${Rosaline's full JID}" role='participant'/>
234 # On discovering the ruse, Romeo restores Juliet's nick and status within the room
237 <iq id='member1' to='room@conference.localhost' type='set'>
238 <query xmlns='http://jabber.org/protocol/muc#admin'>
239 <item affiliation='member' jid="${Juliet's JID}" nick='Juliet' />
243 # Rosaline is evicted from the room
246 <presence from='room@conference.localhost/Juliet' type='unavailable'>
247 <x xmlns='http://jabber.org/protocol/muc#user'>
249 <item affiliation='none' role='none' jid="${Rosaline's full JID}">
250 <reason>This nickname is reserved</reason>
255 # An out-of-room affiliation change is received for Juliet
258 <message from='room@conference.localhost'>
259 <x xmlns='http://jabber.org/protocol/muc#user'>
260 <item jid="${Juliet's JID}" affiliation='member' />
265 <iq type='result' id='member1' from='room@conference.localhost' />
268 <presence type='unavailable' from='room@conference.localhost/Juliet'>
269 <x xmlns='http://jabber.org/protocol/muc#user'>
271 <item affiliation='none' jid="${Rosaline's full JID}" role='none'>
272 <reason>This nickname is reserved</reason>
278 # Rosaline, frustrated, attempts to get back into the room...
281 <presence to="room@conference.localhost/Juliet">
282 <x xmlns="http://jabber.org/protocol/muc"/>
285 # ...but once again, is denied
288 <presence type='error' from='room@conference.localhost/Juliet'>
289 <error type='cancel'>
290 <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
292 <x xmlns='http://jabber.org/protocol/muc'/>
295 # Juliet, however, quietly joins the room with success
298 <presence to="room@conference.localhost/Juliet">
299 <x xmlns="http://jabber.org/protocol/muc"/>
303 <presence from="room@conference.localhost/Romeo" />
306 <presence from="room@conference.localhost/Juliet" />
309 <message type='groupchat' from='room@conference.localhost'><subject/></message>
312 <presence from="room@conference.localhost/Juliet" />
314 # Romeo checks whether he has reserved his own nick yet
317 <iq id='getnick1' to='room@conference.localhost' type='get'>
318 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/>
321 # But no nick is returned, as he hasn't registered yet!
324 <iq type='result' from='room@conference.localhost' id='getnick1'>
325 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item' scansion:strict='true' />
328 # Romeo updates his own registration
331 <iq id='jw81b36f' to='room@conference.localhost' type='get'>
332 <query xmlns='jabber:iq:register'/>
336 <iq type='result' from='room@conference.localhost' id='jw81b36f'>
337 <query xmlns='jabber:iq:register'>
338 <x type='form' xmlns='jabber:x:data'>
339 <field type='hidden' var='FORM_TYPE'>
340 <value>http://jabber.org/protocol/muc#register</value>
342 <field type='text-single' label='Nickname' var='muc#register_roomnick'/>
348 <iq id='nv71va54' to='room@conference.localhost' type='set'>
349 <query xmlns='jabber:iq:register'>
350 <x xmlns='jabber:x:data' type='submit'>
351 <field var='FORM_TYPE'>
352 <value>http://jabber.org/protocol/muc#register</value>
354 <field var='muc#register_roomnick'>
362 <presence from='room@conference.localhost/Romeo'>
363 <x xmlns='http://jabber.org/protocol/muc#user'>
364 <item affiliation='owner' jid="${Romeo's full JID}" role='moderator'/>
370 <iq type='result' from='room@conference.localhost' id='nv71va54'/>
373 <presence from='room@conference.localhost/Romeo'>
374 <x xmlns='http://jabber.org/protocol/muc#user'>
375 <item role='moderator' xmlns='http://jabber.org/protocol/muc#user' affiliation='owner'/>
379 # Romeo discovers his reserved nick
382 <iq id='getnick1' to='room@conference.localhost' type='get'>
383 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/>
387 <iq type='result' from='room@conference.localhost' id='getnick1'>
388 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'>
389 <identity category='conference' name='Romeo' type='text'/>
393 # To check the status of the room is as expected, Romeo requests the member list
396 <iq id='member3' to='room@conference.localhost' type='get'>
397 <query xmlns='http://jabber.org/protocol/muc#admin'>
398 <item affiliation='member'/>
403 <iq from='room@conference.localhost' type='result' id='member3'>
404 <query xmlns='http://jabber.org/protocol/muc#admin'>
405 <item jid="${Juliet's JID}" affiliation='member' nick='Juliet'/>
410 <presence type="unavailable" to="room@conference.localhost/Juliet" />
413 <presence from='room@conference.localhost/Juliet' type='unavailable' />
416 <presence type='unavailable' from='room@conference.localhost/Juliet' />
418 # Rosaline joins as herself
421 <presence to="room@conference.localhost/Rosaline">
422 <x xmlns="http://jabber.org/protocol/muc"/>
426 <presence from="room@conference.localhost/Romeo" />
429 <presence from="room@conference.localhost/Rosaline" />
432 <message type='groupchat' from='room@conference.localhost'><subject/></message>
435 <presence from='room@conference.localhost/Rosaline'>
436 <x xmlns='http://jabber.org/protocol/muc#user'>
437 <item jid="${Rosaline's full JID}" affiliation='none' role='participant'/>
441 # Rosaline tries to register her own nickname, but unaffiliated
442 # registration is disabled by default
445 <iq id='reg990' to='room@conference.localhost' type='get'>
446 <query xmlns='jabber:iq:register'/>
450 <iq type='error' from='room@conference.localhost' id='reg990'>
452 <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
457 <iq id='reg991' to='room@conference.localhost' type='set'>
458 <query xmlns='jabber:iq:register'>
459 <x xmlns='jabber:x:data' type='submit'>
460 <field var='FORM_TYPE'>
461 <value>http://jabber.org/protocol/muc#register</value>
463 <field var='muc#register_roomnick'>
471 <iq id='reg991' type='error'>
473 <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
477 # Romeo reserves her nickname for her
480 <iq id='member2' to='room@conference.localhost' type='set'>
481 <query xmlns='http://jabber.org/protocol/muc#admin'>
482 <item affiliation='member' jid="${Rosaline's JID}" nick='Rosaline' />
487 <presence from='room@conference.localhost/Rosaline'>
488 <x xmlns='http://jabber.org/protocol/muc#user'>
489 <item affiliation='member' role='participant' jid="${Rosaline's full JID}">
490 <actor jid="${Romeo's full JID}" nick='Romeo'/>
496 <iq type='result' id='member2' from='room@conference.localhost' />
499 <presence from='room@conference.localhost/Rosaline'>
500 <x xmlns='http://jabber.org/protocol/muc#user'>
501 <item affiliation='member' role='participant' jid="${Rosaline's full JID}">
502 <actor nick='Romeo' />
504 <status xmlns='http://jabber.org/protocol/muc#user' code='110'/>
508 # Romeo sets their their own nickname via admin query (see #1273)
510 <iq to="room@conference.localhost" id="reserve" type="set">
511 <query xmlns="http://jabber.org/protocol/muc#admin">
512 <item nick="Romeo" affiliation="owner" jid="${Romeo's JID}"/>
517 <presence from="room@conference.localhost/Romeo">
518 <x xmlns="http://jabber.org/protocol/muc#user">
519 <item xmlns="http://jabber.org/protocol/muc#user" role="moderator" jid="${Romeo's full JID}" affiliation="owner">
520 <actor xmlns="http://jabber.org/protocol/muc#user" nick="Romeo"/>
522 <status xmlns="http://jabber.org/protocol/muc#user" code="110"/>
527 <iq from="room@conference.localhost" id="reserve" type="result"/>