Software /
code /
prosody
Annotate
spec/scansion/muc_presence_probe.scs @ 11245:43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
The following patch allows Prosody to respond to `probe` presences and send out the probed occupant's current presence.
This is based on line 17.3 in XEP-0045:
A MUC service MAY handle presence probes sent to the room JID <room@service> or an occupant JID <room@service/nick>
(e.g, these might be sent by an occupant's home server to determine if the room is still online or to synchronize
presence information if the user or the user's server has gone offline temporarily or has started sharing presence again,
as for instance when Stanza Interception and Filtering Technology (XEP-0273) is used).
author | JC Brand <jc@opkode.com> |
---|---|
date | Sun, 19 Apr 2020 21:49:45 +0200 |
child | 11246:ab189e707705 |
rev | line source |
---|---|
11245
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
1 # #1535 Let MUCs respond to presence probes |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
2 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
3 [Client] Romeo |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
4 jid: user@localhost |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
5 password: password |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
6 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
7 [Client] Juliet |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
8 jid: user2@localhost |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
9 password: password |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
10 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
11 [Client] Mercutio |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
12 jid: user3@localhost |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
13 password: password |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
14 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
15 ----- |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
16 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
17 Romeo connects |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
18 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
19 Romeo sends: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
20 <presence to="room@conference.localhost/Romeo"> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
21 <x xmlns="http://jabber.org/protocol/muc"/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
22 </presence> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
23 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
24 Romeo receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
25 <presence from='room@conference.localhost/Romeo'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
26 <x xmlns='http://jabber.org/protocol/muc#user'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
27 <status code='201'/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
28 <item jid="${Romeo's full JID}" affiliation='owner' role='moderator'/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
29 <status code='110'/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
30 </x> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
31 </presence> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
32 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
33 Romeo receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
34 <message type='groupchat' from='room@conference.localhost'><subject/></message> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
35 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
36 # Disable presences for non-mods |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
37 Romeo sends: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
38 <iq id='config1' to='room@conference.localhost' type='set'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
39 <query xmlns='http://jabber.org/protocol/muc#owner'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
40 <x xmlns='jabber:x:data' type='submit'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
41 <field var='FORM_TYPE'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
42 <value>http://jabber.org/protocol/muc#roomconfig</value> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
43 </field> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
44 <field var='muc#roomconfig_presencebroadcast'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
45 <value>moderator</value> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
46 </field> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
47 </x> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
48 </query> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
49 </iq> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
50 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
51 Romeo receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
52 <iq id="config1" from="room@conference.localhost" type="result"> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
53 </iq> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
54 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
55 # Juliet connects, and joins the room |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
56 Juliet connects |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
57 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
58 Juliet sends: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
59 <presence to="room@conference.localhost/Juliet"> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
60 <x xmlns="http://jabber.org/protocol/muc"/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
61 </presence> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
62 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
63 Juliet receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
64 <presence from="room@conference.localhost/Romeo" /> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
65 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
66 Juliet receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
67 <presence from="room@conference.localhost/Juliet" /> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
68 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
69 # Romeo probes Juliet |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
70 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
71 Romeo sends: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
72 <presence to="room@conference.localhost/Juliet" type="probe"> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
73 <x xmlns="http://jabber.org/protocol/muc"/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
74 </presence> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
75 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
76 Romeo receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
77 <presence from='room@conference.localhost/Juliet'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
78 <x xmlns='http://jabber.org/protocol/muc#user'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
79 <item jid="${Juliet's full JID}" affiliation='none' role='participant'/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
80 </x> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
81 </presence> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
82 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
83 # Romeo makes Mercutio a member and registers his nickname |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
84 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
85 Romeo sends: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
86 <iq id='member1' to='room@conference.localhost' type='set'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
87 <query xmlns='http://jabber.org/protocol/muc#admin'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
88 <item affiliation='member' jid="${Mercutio's JID}" nick="Mercutio"/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
89 </query> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
90 </iq> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
91 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
92 Romeo receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
93 <message from='room@conference.localhost'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
94 <x xmlns='http://jabber.org/protocol/muc#user'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
95 <item jid="${Mercutio's JID}" affiliation='member' /> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
96 </x> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
97 </message> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
98 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
99 Romeo receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
100 <iq from='room@conference.localhost' id='member1' type='result'/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
101 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
102 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
103 # Romeo probes Mercutio, even though he's unavailable |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
104 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
105 Romeo sends: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
106 <presence to="room@conference.localhost/Mercutio" type="probe"> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
107 <x xmlns="http://jabber.org/protocol/muc"/> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
108 </presence> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
109 |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
110 Romeo receives: |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
111 <presence from='room@conference.localhost/Mercutio' type="unavailable"> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
112 <x xmlns='http://jabber.org/protocol/muc#user'> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
113 <item nick="Mercutio" affiliation='member' role='none' jid="${Mercutio's JID}" /> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
114 </x> |
43b43e7156b8
MUC: Add support for presence probes (fixes #1535)
JC Brand <jc@opkode.com>
parents:
diff
changeset
|
115 </presence> |