Software /
code /
prosody-modules
Comparison
mod_auto_moved/tests/moved.scs @ 4679:f95a1e197a07
mod_auto_moved: New module implementing XEP-0283 r0.2.0
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 12 Sep 2021 18:49:56 +0100 |
comparison
equal
deleted
inserted
replaced
4678:0bcbff950f14 | 4679:f95a1e197a07 |
---|---|
1 # XEP-0283: Moved | |
2 | |
3 [Client] Romeo | |
4 jid: romeo1@localhost | |
5 password: password | |
6 | |
7 [Client] RomeoNew | |
8 jid: romeo.new@localhost | |
9 password: password | |
10 | |
11 [Client] Juliet | |
12 jid: juliet.m@localhost | |
13 password: password | |
14 | |
15 ----- | |
16 | |
17 # The parties connect | |
18 Romeo connects | |
19 | |
20 Romeo sends: | |
21 <presence/> | |
22 | |
23 Romeo receives: | |
24 <presence from="${Romeo's full JID}"/> | |
25 | |
26 Juliet connects | |
27 | |
28 Juliet sends: | |
29 <presence/> | |
30 | |
31 Juliet receives: | |
32 <presence from="${Juliet's full JID}"/> | |
33 | |
34 RomeoNew connects | |
35 | |
36 RomeoNew sends: | |
37 <presence/> | |
38 | |
39 RomeoNew receives: | |
40 <presence from="${RomeoNew's full JID}"/> | |
41 | |
42 # They add each other | |
43 Romeo sends: | |
44 <presence type="subscribe" to="${Juliet's JID}"/> | |
45 | |
46 Romeo receives: | |
47 <presence from="${Juliet's JID}" to="${Romeo's JID}" type="unavailable"/> | |
48 | |
49 Juliet receives: | |
50 <presence type="subscribe" to="${Juliet's JID}" from="${Romeo's JID}"/> | |
51 | |
52 Juliet sends: | |
53 <presence type="subscribed" to="${Romeo's JID}"/> | |
54 | |
55 Romeo receives: | |
56 <presence from="${Juliet's full JID}" to="${Romeo's JID}"> | |
57 <delay xmlns="urn:xmpp:delay" stamp="{scansion:any}" from="localhost"/> | |
58 </presence> | |
59 | |
60 Juliet sends: | |
61 <presence type="subscribe" to="${Romeo's JID}"/> | |
62 | |
63 Juliet receives: | |
64 <presence from="${Romeo's JID}" to="${Juliet's JID}" type="unavailable"/> | |
65 | |
66 Romeo receives: | |
67 <presence type="subscribe" to="${Romeo's JID}" from="${Juliet's JID}"/> | |
68 | |
69 Romeo sends: | |
70 <presence type="subscribed" to="${Juliet's JID}"/> | |
71 | |
72 Juliet receives: | |
73 <presence from="${Romeo's full JID}" to="${Juliet's JID}"> | |
74 <delay xmlns="urn:xmpp:delay" stamp="{scansion:any}" from="localhost"/> | |
75 </presence> | |
76 | |
77 Romeo receives: | |
78 <presence from="${Juliet's full JID}" to="${Romeo's JID}"> | |
79 <delay xmlns="urn:xmpp:delay" stamp="{scansion:any}" from="localhost"/> | |
80 </presence> | |
81 | |
82 # They request their rosters | |
83 | |
84 Juliet sends: | |
85 <iq type="get" id="roster1"> | |
86 <query xmlns='jabber:iq:roster'/> | |
87 </iq> | |
88 | |
89 Juliet receives: | |
90 <iq type="result" id="roster1"/> | |
91 | |
92 RomeoNew sends: | |
93 <iq type="get" id="roster1"> | |
94 <query xmlns='jabber:iq:roster'/> | |
95 </iq> | |
96 | |
97 RomeoNew receives: | |
98 <iq type="result" id="roster1"/> | |
99 | |
100 # They can now talk | |
101 Juliet sends: | |
102 <message type="chat" to="${Romeo's JID}"> | |
103 <body>ohai</body> | |
104 </message> | |
105 | |
106 Romeo receives: | |
107 <message type="chat" to="${Romeo's JID}" from="${Juliet's full JID}"> | |
108 <body>ohai</body> | |
109 </message> | |
110 | |
111 # Romeo moves to a new account | |
112 | |
113 # Romeo publishes a moved statement | |
114 | |
115 Romeo sends: | |
116 <iq type='set' id='pub1'> | |
117 <pubsub xmlns='http://jabber.org/protocol/pubsub'> | |
118 <publish node='urn:xmpp:moved:1'> | |
119 <item id='current'> | |
120 <moved xmlns='urn:xmpp:moved:1'> | |
121 <new-jid>${RomeoNew's JID}</new-jid> | |
122 </moved> | |
123 </item> | |
124 </publish> | |
125 <publish-options> | |
126 <x xmlns='jabber:x:data' type='submit'> | |
127 <field var='FORM_TYPE' type='hidden'> | |
128 <value>http://jabber.org/protocol/pubsub#publish-options</value> | |
129 </field> | |
130 <field var='pubsub#access_model'> | |
131 <value>open</value> | |
132 </field> | |
133 </x> | |
134 </publish-options> | |
135 </pubsub> | |
136 </iq> | |
137 | |
138 Romeo receives: | |
139 <iq type="result" id="pub1"> | |
140 <pubsub xmlns='http://jabber.org/protocol/pubsub'> | |
141 <publish node='urn:xmpp:moved:1'> | |
142 <item id='current'/> | |
143 </publish> | |
144 </pubsub> | |
145 </iq> | |
146 | |
147 | |
148 | |
149 # RomeoNew sends moved notification to Juliet | |
150 RomeoNew sends: | |
151 <presence type="subscribe" to="${Juliet's JID}"> | |
152 <moved xmlns="urn:xmpp:moved:1"> | |
153 <old-jid>${Romeo's JID}</old-jid> | |
154 </moved> | |
155 </presence> | |
156 | |
157 RomeoNew receives: | |
158 <iq type='set' id="{scansion:any}"> | |
159 <query ver="{scansion:any}" xmlns='jabber:iq:roster'> | |
160 <item jid="${Juliet's JID}" subscription='none' ask='subscribe'/> | |
161 </query> | |
162 </iq> | |
163 | |
164 # Juliet's server verifies and approves the subscription request | |
165 | |
166 RomeoNew receives: | |
167 <presence type="subscribed" from="${Juliet's JID}"/> | |
168 | |
169 RomeoNew receives: | |
170 <iq type='set' id="{scansion:any}"> | |
171 <query ver="{scansion:any}" xmlns='jabber:iq:roster'> | |
172 <item jid="${Juliet's JID}" subscription='to' /> | |
173 </query> | |
174 </iq> | |
175 | |
176 # Juliet's server notifies her via a roster push | |
177 | |
178 Juliet receives: | |
179 <iq type="set" id="{scansion:any}"> | |
180 <query xmlns='jabber:iq:roster' ver='{scansion:any}'> | |
181 <item jid="${RomeoNew's JID}" subscription='from'/> | |
182 </query> | |
183 </iq> | |
184 |