Software /
code /
prosody
Comparison
spec/scansion/blocking.scs @ 10050:f29d662d16f8 0.11
mod_blocklist: Add test case capturing current behavior
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 20 Jun 2019 21:08:12 +0200 |
child | 10051:7d312e77c857 |
comparison
equal
deleted
inserted
replaced
10045:6714578cfd6e | 10050:f29d662d16f8 |
---|---|
1 # XEP-0191: Blocking Command | |
2 | |
3 [Client] Romeo | |
4 jid: blocker@localhost | |
5 password: password | |
6 | |
7 [Client] Juliet | |
8 jid: blockee@localhost | |
9 password: password | |
10 | |
11 ----- | |
12 | |
13 # The parties connect | |
14 Romeo connects | |
15 | |
16 Romeo sends: | |
17 <presence/> | |
18 | |
19 Romeo receives: | |
20 <presence from="${Romeo's full JID}"> | |
21 <x xmlns="vcard-temp:x:update"/> | |
22 </presence> | |
23 | |
24 Juliet connects | |
25 | |
26 Juliet sends: | |
27 <presence/> | |
28 | |
29 Juliet receives: | |
30 <presence from="${Juliet's full JID}"> | |
31 <x xmlns="vcard-temp:x:update"/> | |
32 </presence> | |
33 | |
34 # They add each other | |
35 Romeo sends: | |
36 <presence type="subscribe" to="${Juliet's JID}"/> | |
37 | |
38 Romeo receives: | |
39 <presence from="${Juliet's JID}" to="${Romeo's JID}" type="unavailable"/> | |
40 | |
41 Juliet receives: | |
42 <presence type="subscribe" to="${Juliet's JID}" from="${Romeo's JID}"/> | |
43 | |
44 Juliet sends: | |
45 <presence type="subscribed" to="${Romeo's JID}"/> | |
46 | |
47 Romeo receives: | |
48 <presence from="${Juliet's full JID}" to="${Romeo's JID}"> | |
49 <delay xmlns="urn:xmpp:delay" stamp="{scansion:any}" from="localhost"/> | |
50 <x xmlns="vcard-temp:x:update"/> | |
51 </presence> | |
52 | |
53 Juliet sends: | |
54 <presence type="subscribe" to="${Romeo's JID}"/> | |
55 | |
56 Juliet receives: | |
57 <presence from="${Romeo's JID}" to="${Juliet's JID}" type="unavailable"/> | |
58 | |
59 Romeo receives: | |
60 <presence type="subscribe" to="${Romeo's JID}" from="${Juliet's JID}"/> | |
61 | |
62 Romeo sends: | |
63 <presence type="subscribed" to="${Juliet's JID}"/> | |
64 | |
65 Juliet receives: | |
66 <presence from="${Romeo's full JID}" to="${Juliet's JID}"> | |
67 <delay xmlns="urn:xmpp:delay" stamp="{scansion:any}" from="localhost"/> | |
68 <x xmlns="vcard-temp:x:update"/> | |
69 </presence> | |
70 | |
71 Romeo receives: | |
72 <presence from="${Juliet's full JID}" to="${Romeo's JID}"> | |
73 <delay xmlns="urn:xmpp:delay" stamp="{scansion:any}" from="localhost"/> | |
74 <x xmlns="vcard-temp:x:update"/> | |
75 </presence> | |
76 | |
77 # They can now talk | |
78 Juliet sends: | |
79 <message type="chat" to="${Romeo's JID}"> | |
80 <body>ohai</body> | |
81 </message> | |
82 | |
83 Romeo receives: | |
84 <message type="chat" to="${Romeo's JID}" from="${Juliet's full JID}"> | |
85 <body>ohai</body> | |
86 </message> | |
87 | |
88 # And now to the blockining | |
89 | |
90 Romeo sends: | |
91 <iq type="set" id="lx2"> | |
92 <block xmlns="urn:xmpp:blocking"> | |
93 <item jid="${Juliet's JID}"/> | |
94 </block> | |
95 </iq> | |
96 | |
97 Romeo receives: | |
98 <iq type="result" id="lx2"/> | |
99 | |
100 Juliet receives: | |
101 <presence type="unavailable" to="${Juliet's JID}" from="${Romeo's full JID}"/> | |
102 | |
103 # Can"t talk anymore | |
104 Romeo sends: | |
105 <message type="chat" to="${Juliet's JID}"> | |
106 <body>hello?</body> | |
107 </message> | |
108 | |
109 Romeo receives: | |
110 <message type="error" from="${Juliet's JID}"> | |
111 <error type="cancel"> | |
112 <not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> | |
113 <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">You have blocked this JID</text> | |
114 <blocked xmlns="urn:xmpp:blocking:errors"/> | |
115 </error> | |
116 </message> | |
117 | |
118 Juliet sends: | |
119 <message type="chat" to="${Romeo's JID}"/> | |
120 | |
121 Juliet receives: | |
122 <message type="error" from="${Romeo's JID}"> | |
123 <error type="cancel"> | |
124 <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> | |
125 </error> | |
126 </message> | |
127 | |
128 Romeo sends: | |
129 <iq type="set" id="lx3"> | |
130 <unblock xmlns="urn:xmpp:blocking"> | |
131 <item jid="${Juliet's JID}"/> | |
132 </unblock> | |
133 </iq> | |
134 | |
135 Romeo receives: | |
136 <iq type="result" id="lx3"/> | |
137 | |
138 # Can talk again | |
139 Romeo sends: | |
140 <message type="chat" to="${Juliet's JID}"> | |
141 <body>hello!</body> | |
142 </message> | |
143 | |
144 Juliet receives: | |
145 <message type="chat" to="${Juliet's JID}" from="${Romeo's full JID}"> | |
146 <body>hello!</body> | |
147 </message> | |
148 | |
149 # Bye | |
150 Juliet disconnects | |
151 | |
152 Juliet sends: | |
153 <presence type="unavailable"/> | |
154 | |
155 Romeo receives: | |
156 <presence from="${Juliet's full JID}" to="${Romeo's JID}" type="unavailable"/> | |
157 | |
158 Romeo disconnects | |
159 | |
160 Romeo sends: | |
161 <presence type="unavailable"/> | |
162 |