Software /
code /
prosody
Comparison
spec/scansion/muc_show_offline.scs @ 10687:8c2c5b4fde32
MUC: Support for broadcasting unavailable presence for affiliated offline users
Activated when muc#roomconfig_presencebroadcast includes the "none" role.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 12 Mar 2020 16:01:31 +0000 |
child | 10759:817f1d6b499e |
comparison
equal
deleted
inserted
replaced
10686:ac3ec4f2b124 | 10687:8c2c5b4fde32 |
---|---|
1 # MUC: Room registration and presence broadcast of unavailable members | |
2 | |
3 [Client] Romeo | |
4 jid: user@localhost | |
5 password: password | |
6 | |
7 [Client] Juliet | |
8 jid: user2@localhost | |
9 password: password | |
10 | |
11 [Client] Rosaline | |
12 jid: user3@localhost | |
13 password: password | |
14 | |
15 ----- | |
16 | |
17 Romeo connects | |
18 | |
19 Romeo sends: | |
20 <presence to="room@conference.localhost/Romeo"> | |
21 <x xmlns="http://jabber.org/protocol/muc"/> | |
22 </presence> | |
23 | |
24 Romeo receives: | |
25 <presence from='room@conference.localhost/Romeo'> | |
26 <x xmlns='http://jabber.org/protocol/muc#user'> | |
27 <status code='201'/> | |
28 <item jid="${Romeo's full JID}" affiliation='owner' role='moderator'/> | |
29 <status code='110'/> | |
30 </x> | |
31 </presence> | |
32 | |
33 Romeo receives: | |
34 <message type='groupchat' from='room@conference.localhost'><subject/></message> | |
35 | |
36 # Submit config form | |
37 Romeo sends: | |
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> | |
43 </field> | |
44 <field var='muc#roomconfig_presencebroadcast'> | |
45 <value>none</value> | |
46 <value>participant</value> | |
47 <value>moderator</value> | |
48 </field> | |
49 </x> | |
50 </query> | |
51 </iq> | |
52 | |
53 Romeo receives: | |
54 <iq id="config1" from="room@conference.localhost" type="result"> | |
55 </iq> | |
56 | |
57 Romeo sends: | |
58 <iq id='member1' to='room@conference.localhost' type='set'> | |
59 <query xmlns='http://jabber.org/protocol/muc#admin'> | |
60 <item affiliation='member' jid="${Juliet's JID}" /> | |
61 </query> | |
62 </iq> | |
63 | |
64 Romeo receives: | |
65 <message from='room@conference.localhost'> | |
66 <x xmlns='http://jabber.org/protocol/muc#user'> | |
67 <item jid="${Juliet's JID}" affiliation='member' /> | |
68 </x> | |
69 </message> | |
70 | |
71 Romeo receives: | |
72 <iq from='room@conference.localhost' id='member1' type='result'/> | |
73 | |
74 # Juliet connects, and joins the room | |
75 Juliet connects | |
76 | |
77 Juliet sends: | |
78 <presence to="room@conference.localhost/Juliet"> | |
79 <x xmlns="http://jabber.org/protocol/muc"/> | |
80 </presence> | |
81 | |
82 Juliet receives: | |
83 <presence from="room@conference.localhost/Romeo" /> | |
84 | |
85 Juliet receives: | |
86 <presence from="room@conference.localhost/Juliet" /> | |
87 | |
88 Juliet receives: | |
89 <message type='groupchat' from='room@conference.localhost'><subject/></message> | |
90 | |
91 Romeo receives: | |
92 <presence from="room@conference.localhost/Juliet" /> | |
93 | |
94 # Juliet retrieves the registration form | |
95 | |
96 Juliet sends: | |
97 <iq id='jw81b36f' to='room@conference.localhost' type='get'> | |
98 <query xmlns='jabber:iq:register'/> | |
99 </iq> | |
100 | |
101 Juliet receives: | |
102 <iq type='result' from='room@conference.localhost' id='jw81b36f'> | |
103 <query xmlns='jabber:iq:register'> | |
104 <x type='form' xmlns='jabber:x:data'> | |
105 <field type='hidden' var='FORM_TYPE'> | |
106 <value>http://jabber.org/protocol/muc#register</value> | |
107 </field> | |
108 <field type='text-single' label='Nickname' var='muc#register_roomnick'> | |
109 <required/> | |
110 </field> | |
111 </x> | |
112 </query> | |
113 </iq> | |
114 | |
115 Juliet sends: | |
116 <iq id='nv71va54' to='room@conference.localhost' type='set'> | |
117 <query xmlns='jabber:iq:register'> | |
118 <x xmlns='jabber:x:data' type='submit'> | |
119 <field var='FORM_TYPE'> | |
120 <value>http://jabber.org/protocol/muc#register</value> | |
121 </field> | |
122 <field var='muc#register_roomnick'> | |
123 <value>Juliet</value> | |
124 </field> | |
125 </x> | |
126 </query> | |
127 </iq> | |
128 | |
129 Juliet receives: | |
130 <presence from='room@conference.localhost/Juliet'> | |
131 <x xmlns='http://jabber.org/protocol/muc#user'> | |
132 <item affiliation='member' jid="${Juliet's full JID}" role='participant'/> | |
133 <status code='110'/> | |
134 </x> | |
135 </presence> | |
136 | |
137 Juliet receives: | |
138 <iq type='result' from='room@conference.localhost' id='nv71va54'/> | |
139 | |
140 # Juliet discovers her reserved nick | |
141 | |
142 Juliet sends: | |
143 <iq id='getnick1' to='room@conference.localhost' type='get'> | |
144 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/> | |
145 </iq> | |
146 | |
147 Juliet receives: | |
148 <iq type='result' from='room@conference.localhost' id='getnick1'> | |
149 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'> | |
150 <identity category='conference' name='Juliet' type='text'/> | |
151 </query> | |
152 </iq> | |
153 | |
154 # Juliet leaves the room: | |
155 | |
156 Juliet sends: | |
157 <presence type="unavailable" to="room@conference.localhost/Juliet" /> | |
158 | |
159 Juliet receives: | |
160 <presence type='unavailable' from='room@conference.localhost/Juliet'> | |
161 <x xmlns='http://jabber.org/protocol/muc#user'> | |
162 <item jid="${Juliet's full JID}" affiliation='member' role='none'/> | |
163 <status code='110'/> | |
164 </x> | |
165 </presence> | |
166 | |
167 Romeo receives: | |
168 <presence from='room@conference.localhost/Juliet'> | |
169 <x xmlns='http://jabber.org/protocol/muc#user'> | |
170 <item jid="${Juliet's full JID}" affiliation='member' role='participant'/> | |
171 </x> | |
172 </presence> | |
173 | |
174 # Rosaline connect and tries to join the room as Juliet | |
175 | |
176 Rosaline connects | |
177 | |
178 Rosaline sends: | |
179 <presence to="room@conference.localhost/Juliet"> | |
180 <x xmlns="http://jabber.org/protocol/muc"/> | |
181 </presence> | |
182 | |
183 Rosaline receives: | |
184 <presence type='error' from='room@conference.localhost/Juliet'> | |
185 <error type='cancel' by='room@conference.localhost'> | |
186 <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | |
187 </error> | |
188 <x xmlns='http://jabber.org/protocol/muc'/> | |
189 </presence> | |
190 | |
191 # In a heated moment, Juliet unregisters from the room | |
192 | |
193 Juliet sends: | |
194 <iq type='set' to='room@conference.localhost' id='unreg1'> | |
195 <query xmlns='jabber:iq:register'> | |
196 <remove/> | |
197 </query> | |
198 </iq> | |
199 | |
200 Juliet receives: | |
201 <iq type='result' from='room@conference.localhost' id='unreg1'/> | |
202 | |
203 # Romeo is notified of Juliet's sad decision | |
204 | |
205 Romeo receives: | |
206 <message from='room@conference.localhost'> | |
207 <x xmlns='http://jabber.org/protocol/muc#user' scansion:strict='true'> | |
208 <item jid="${Juliet's JID}" /> | |
209 </x> | |
210 </message> | |
211 | |
212 # Rosaline attempts once more to sneak into the room, disguised as Juliet | |
213 | |
214 Rosaline sends: | |
215 <presence to="room@conference.localhost/Juliet"> | |
216 <x xmlns="http://jabber.org/protocol/muc"/> | |
217 </presence> | |
218 | |
219 Rosaline receives: | |
220 <presence from='room@conference.localhost/Romeo'> | |
221 <x xmlns='http://jabber.org/protocol/muc#user'> | |
222 <item affiliation='owner' role='moderator'/> | |
223 </x> | |
224 </presence> | |
225 | |
226 Rosaline receives: | |
227 <presence from='room@conference.localhost/Juliet'> | |
228 <x xmlns='http://jabber.org/protocol/muc#user'> | |
229 <item affiliation='none' jid="${Rosaline's full JID}" role='participant'/> | |
230 <status code='110'/> | |
231 </x> | |
232 </presence> | |
233 | |
234 Romeo receives: | |
235 <presence from='room@conference.localhost/Juliet'> | |
236 <x xmlns='http://jabber.org/protocol/muc#user'> | |
237 <item affiliation='none' jid="${Rosaline's full JID}" role='participant'/> | |
238 </x> | |
239 </presence> | |
240 | |
241 # On discovering the ruse, Romeo restores Juliet's nick and status within the room | |
242 | |
243 Romeo sends: | |
244 <iq id='member1' to='room@conference.localhost' type='set'> | |
245 <query xmlns='http://jabber.org/protocol/muc#admin'> | |
246 <item affiliation='member' jid="${Juliet's JID}" nick='Juliet' /> | |
247 </query> | |
248 </iq> | |
249 | |
250 # Rosaline is evicted from the room | |
251 | |
252 Romeo receives: | |
253 <presence from='room@conference.localhost/Juliet' type='unavailable'> | |
254 <x xmlns='http://jabber.org/protocol/muc#user'> | |
255 <status code='307'/> | |
256 <item affiliation='none' role='none' jid="${Rosaline's full JID}"> | |
257 <reason>This nickname is reserved</reason> | |
258 </item> | |
259 </x> | |
260 </presence> | |
261 | |
262 # An out-of-room affiliation change is received for Juliet | |
263 | |
264 Romeo receives: | |
265 <message from='room@conference.localhost'> | |
266 <x xmlns='http://jabber.org/protocol/muc#user'> | |
267 <item jid="${Juliet's JID}" affiliation='member' /> | |
268 </x> | |
269 </message> | |
270 | |
271 Romeo receives: | |
272 <iq type='result' id='member1' from='room@conference.localhost' /> | |
273 | |
274 Rosaline receives: | |
275 <presence type='unavailable' from='room@conference.localhost/Juliet'> | |
276 <x xmlns='http://jabber.org/protocol/muc#user'> | |
277 <status code='307'/> | |
278 <item affiliation='none' jid="${Rosaline's full JID}" role='none'> | |
279 <reason>This nickname is reserved</reason> | |
280 </item> | |
281 <status code='110'/> | |
282 </x> | |
283 </presence> | |
284 | |
285 # Rosaline, frustrated, attempts to get back into the room... | |
286 | |
287 Rosaline sends: | |
288 <presence to="room@conference.localhost/Juliet"> | |
289 <x xmlns="http://jabber.org/protocol/muc"/> | |
290 </presence> | |
291 | |
292 # ...but once again, is denied | |
293 | |
294 Rosaline receives: | |
295 <presence type='error' from='room@conference.localhost/Juliet'> | |
296 <error type='cancel' by='room@conference.localhost'> | |
297 <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | |
298 </error> | |
299 <x xmlns='http://jabber.org/protocol/muc'/> | |
300 </presence> | |
301 | |
302 # Juliet, however, quietly joins the room with success | |
303 | |
304 Juliet sends: | |
305 <presence to="room@conference.localhost/Juliet"> | |
306 <x xmlns="http://jabber.org/protocol/muc"/> | |
307 </presence> | |
308 | |
309 Juliet receives: | |
310 <presence from="room@conference.localhost/Romeo" /> | |
311 | |
312 Juliet receives: | |
313 <presence from="room@conference.localhost/Juliet" /> | |
314 | |
315 Juliet receives: | |
316 <message type='groupchat' from='room@conference.localhost'><subject/></message> | |
317 | |
318 Romeo receives: | |
319 <presence from="room@conference.localhost/Juliet" /> | |
320 | |
321 # Romeo checks whether he has reserved his own nick yet | |
322 | |
323 Romeo sends: | |
324 <iq id='getnick1' to='room@conference.localhost' type='get'> | |
325 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/> | |
326 </iq> | |
327 | |
328 # But no nick is returned, as he hasn't registered yet! | |
329 | |
330 Romeo receives: | |
331 <iq type='result' from='room@conference.localhost' id='getnick1'> | |
332 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item' scansion:strict='true' /> | |
333 </iq> | |
334 | |
335 # Romeo updates his own registration | |
336 | |
337 Romeo sends: | |
338 <iq id='jw81b36f' to='room@conference.localhost' type='get'> | |
339 <query xmlns='jabber:iq:register'/> | |
340 </iq> | |
341 | |
342 Romeo receives: | |
343 <iq type='result' from='room@conference.localhost' id='jw81b36f'> | |
344 <query xmlns='jabber:iq:register'> | |
345 <x type='form' xmlns='jabber:x:data'> | |
346 <field type='hidden' var='FORM_TYPE'> | |
347 <value>http://jabber.org/protocol/muc#register</value> | |
348 </field> | |
349 <field type='text-single' label='Nickname' var='muc#register_roomnick'> | |
350 <required/> | |
351 </field> | |
352 </x> | |
353 </query> | |
354 </iq> | |
355 | |
356 Romeo sends: | |
357 <iq id='nv71va54' to='room@conference.localhost' type='set'> | |
358 <query xmlns='jabber:iq:register'> | |
359 <x xmlns='jabber:x:data' type='submit'> | |
360 <field var='FORM_TYPE'> | |
361 <value>http://jabber.org/protocol/muc#register</value> | |
362 </field> | |
363 <field var='muc#register_roomnick'> | |
364 <value>Romeo</value> | |
365 </field> | |
366 </x> | |
367 </query> | |
368 </iq> | |
369 | |
370 Romeo receives: | |
371 <presence from='room@conference.localhost/Romeo'> | |
372 <x xmlns='http://jabber.org/protocol/muc#user'> | |
373 <item affiliation='owner' jid="${Romeo's full JID}" role='moderator'/> | |
374 <status code='110'/> | |
375 </x> | |
376 </presence> | |
377 | |
378 Romeo receives: | |
379 <iq type='result' from='room@conference.localhost' id='nv71va54'/> | |
380 | |
381 Juliet receives: | |
382 <presence from='room@conference.localhost/Romeo'> | |
383 <x xmlns='http://jabber.org/protocol/muc#user'> | |
384 <item role='moderator' xmlns='http://jabber.org/protocol/muc#user' affiliation='owner'/> | |
385 </x> | |
386 </presence> | |
387 | |
388 # Romeo discovers his reserved nick | |
389 | |
390 Romeo sends: | |
391 <iq id='getnick1' to='room@conference.localhost' type='get'> | |
392 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/> | |
393 </iq> | |
394 | |
395 Romeo receives: | |
396 <iq type='result' from='room@conference.localhost' id='getnick1'> | |
397 <query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'> | |
398 <identity category='conference' name='Romeo' type='text'/> | |
399 </query> | |
400 </iq> | |
401 | |
402 # To check the status of the room is as expected, Romeo requests the member list | |
403 | |
404 Romeo sends: | |
405 <iq id='member3' to='room@conference.localhost' type='get'> | |
406 <query xmlns='http://jabber.org/protocol/muc#admin'> | |
407 <item affiliation='member'/> | |
408 </query> | |
409 </iq> | |
410 | |
411 Romeo receives: | |
412 <iq from='room@conference.localhost' type='result' id='member3'> | |
413 <query xmlns='http://jabber.org/protocol/muc#admin'> | |
414 <item jid="${Juliet's JID}" affiliation='member' nick='Juliet'/> | |
415 </query> | |
416 </iq> | |
417 | |
418 Juliet sends: | |
419 <presence type="unavailable" to="room@conference.localhost/Juliet" /> | |
420 | |
421 Juliet receives: | |
422 <presence from='room@conference.localhost/Juliet' type='unavailable' /> | |
423 | |
424 Romeo receives: | |
425 <presence type='unavailable' from='room@conference.localhost/Juliet' /> | |
426 | |
427 # Rosaline joins as herself | |
428 | |
429 Rosaline sends: | |
430 <presence to="room@conference.localhost/Rosaline"> | |
431 <x xmlns="http://jabber.org/protocol/muc"/> | |
432 </presence> | |
433 | |
434 Rosaline receives: | |
435 <presence from="room@conference.localhost/Romeo" /> | |
436 | |
437 Rosaline receives: | |
438 <presence from='room@conference.localhost/Juliet' type='unavailable'> | |
439 <x xmlns='http://jabber.org/protocol/muc#user'> | |
440 <item affiliation='member' role='none' nick='Juliet' xmlns='http://jabber.org/protocol/muc#user'/> | |
441 </x> | |
442 </presence> | |
443 | |
444 Rosaline receives: | |
445 <presence from="room@conference.localhost/Rosaline" /> | |
446 | |
447 Rosaline receives: | |
448 <message type='groupchat' from='room@conference.localhost'><subject/></message> | |
449 | |
450 Romeo receives: | |
451 <presence from='room@conference.localhost/Rosaline'> | |
452 <x xmlns='http://jabber.org/protocol/muc#user'> | |
453 <item jid="${Rosaline's full JID}" affiliation='none' role='participant'/> | |
454 </x> | |
455 </presence> | |
456 | |
457 # Rosaline tries to register her own nickname, but unaffiliated | |
458 # registration is disabled by default | |
459 | |
460 Rosaline sends: | |
461 <iq id='reg990' to='room@conference.localhost' type='get'> | |
462 <query xmlns='jabber:iq:register'/> | |
463 </iq> | |
464 | |
465 Rosaline receives: | |
466 <iq type='error' from='room@conference.localhost' id='reg990'> | |
467 <error type='auth'> | |
468 <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | |
469 </error> | |
470 </iq> | |
471 | |
472 Rosaline sends: | |
473 <iq id='reg991' to='room@conference.localhost' type='set'> | |
474 <query xmlns='jabber:iq:register'> | |
475 <x xmlns='jabber:x:data' type='submit'> | |
476 <field var='FORM_TYPE'> | |
477 <value>http://jabber.org/protocol/muc#register</value> | |
478 </field> | |
479 <field var='muc#register_roomnick'> | |
480 <value>Romeo</value> | |
481 </field> | |
482 </x> | |
483 </query> | |
484 </iq> | |
485 | |
486 Rosaline receives: | |
487 <iq id='reg991' type='error'> | |
488 <error type='auth'> | |
489 <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | |
490 </error> | |
491 </iq> | |
492 | |
493 # Romeo reserves her nickname for her | |
494 | |
495 Romeo sends: | |
496 <iq id='member2' to='room@conference.localhost' type='set'> | |
497 <query xmlns='http://jabber.org/protocol/muc#admin'> | |
498 <item affiliation='member' jid="${Rosaline's JID}" nick='Rosaline' /> | |
499 </query> | |
500 </iq> | |
501 | |
502 Romeo receives: | |
503 <presence from='room@conference.localhost/Rosaline'> | |
504 <x xmlns='http://jabber.org/protocol/muc#user'> | |
505 <item affiliation='member' role='participant' jid="${Rosaline's full JID}"> | |
506 <actor jid="${Romeo's full JID}" nick='Romeo'/> | |
507 </item> | |
508 </x> | |
509 </presence> | |
510 | |
511 Romeo receives: | |
512 <iq type='result' id='member2' from='room@conference.localhost' /> | |
513 | |
514 Rosaline receives: | |
515 <presence from='room@conference.localhost/Rosaline'> | |
516 <x xmlns='http://jabber.org/protocol/muc#user'> | |
517 <item affiliation='member' role='participant' jid="${Rosaline's full JID}"> | |
518 <actor nick='Romeo' /> | |
519 </item> | |
520 <status xmlns='http://jabber.org/protocol/muc#user' code='110'/> | |
521 </x> | |
522 </presence> | |
523 | |
524 # Romeo sets their their own nickname via admin query (see #1273) | |
525 Romeo sends: | |
526 <iq to="room@conference.localhost" id="reserve" type="set"> | |
527 <query xmlns="http://jabber.org/protocol/muc#admin"> | |
528 <item nick="Romeo" affiliation="owner" jid="${Romeo's JID}"/> | |
529 </query> | |
530 </iq> | |
531 | |
532 Romeo receives: | |
533 <presence from="room@conference.localhost/Romeo"> | |
534 <x xmlns="http://jabber.org/protocol/muc#user"> | |
535 <item xmlns="http://jabber.org/protocol/muc#user" role="moderator" jid="${Romeo's full JID}" affiliation="owner"> | |
536 <actor xmlns="http://jabber.org/protocol/muc#user" nick="Romeo"/> | |
537 </item> | |
538 <status xmlns="http://jabber.org/protocol/muc#user" code="110"/> | |
539 </x> | |
540 </presence> | |
541 | |
542 Romeo receives: | |
543 <iq from="room@conference.localhost" id="reserve" type="result"/> | |
544 |