Software /
code /
prosody
Comparison
spec/scansion/pubsub_resend_on_sub.scs @ 11854:b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Default left as 'never' in mod_pubsub to preserve the previous behavior.
Unclear if this is desirable, but can always be changed later.
In mod_pep this allows turning off the automatic resending of most
recent item.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 19 Oct 2021 18:11:50 +0200 |
parent | 11714:spec/scansion/pubsub_basic.scs@d783716103c1 |
comparison
equal
deleted
inserted
replaced
11853:ae5ac9830add | 11854:b605cbd5f13b |
---|---|
1 # Pubsub: Send last item on subscribe #1436 | |
2 | |
3 [Client] Romeo | |
4 jid: admin@localhost | |
5 password: password | |
6 | |
7 // admin@localhost is assumed to have node creation privileges | |
8 | |
9 [Client] Juliet | |
10 jid: juliet@localhost | |
11 password: password | |
12 | |
13 --------- | |
14 | |
15 Romeo connects | |
16 | |
17 Romeo sends: | |
18 <iq type="set" to="pubsub.localhost" id='create1'> | |
19 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
20 <create node="princely_musings"/> | |
21 </pubsub> | |
22 </iq> | |
23 | |
24 Romeo receives: | |
25 <iq type="result" id='create1'/> | |
26 | |
27 Romeo sends: | |
28 <iq to="pubsub.localhost" id="config-never" type="set"> | |
29 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
30 <configure node="princely_musings"> | |
31 <x xmlns="jabber:x:data" type="submit"> | |
32 <field var="FORM_TYPE" type="hidden"> | |
33 <value>http://jabber.org/protocol/pubsub#node_config</value> | |
34 </field> | |
35 <field type='list-single' var='pubsub#send_last_published_item'> | |
36 <value>never</value> | |
37 </field> | |
38 </x> | |
39 </configure> | |
40 </pubsub> | |
41 </iq> | |
42 | |
43 Romeo receives: | |
44 <iq from="pubsub.localhost" id="config-never" type="result"/> | |
45 | |
46 Romeo sends: | |
47 <iq type="set" to="pubsub.localhost" id='pub1'> | |
48 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
49 <publish node="princely_musings"> | |
50 <item id="current"> | |
51 <entry xmlns="http://www.w3.org/2005/Atom"> | |
52 <title>Soliloquy</title> | |
53 <summary>Lorem ipsum dolor sit amet</summary> | |
54 </entry> | |
55 </item> | |
56 </publish> | |
57 </pubsub> | |
58 </iq> | |
59 | |
60 Romeo receives: | |
61 <iq type="result" id='pub1'/> | |
62 | |
63 Juliet connects | |
64 | |
65 Juliet sends: | |
66 <iq type="set" to="pubsub.localhost" id='sub1'> | |
67 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
68 <subscribe node="princely_musings" jid="${Juliet's full JID}"/> | |
69 </pubsub> | |
70 </iq> | |
71 | |
72 Juliet receives: | |
73 <iq type="result" id='sub1'/> | |
74 | |
75 Juliet sends: | |
76 <iq type="set" to="pubsub.localhost" id='unsub1'> | |
77 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
78 <unsubscribe node="princely_musings" jid="${Juliet's full JID}"/> | |
79 </pubsub> | |
80 </iq> | |
81 | |
82 Juliet receives: | |
83 <iq type="result" id='unsub1'/> | |
84 | |
85 Romeo sends: | |
86 <iq to="pubsub.localhost" id="config-on_sub" type="set"> | |
87 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
88 <configure node="princely_musings"> | |
89 <x xmlns="jabber:x:data" type="submit"> | |
90 <field var="FORM_TYPE" type="hidden"> | |
91 <value>http://jabber.org/protocol/pubsub#node_config</value> | |
92 </field> | |
93 <field type='list-single' var='pubsub#send_last_published_item'> | |
94 <value>on_sub</value> | |
95 </field> | |
96 </x> | |
97 </configure> | |
98 </pubsub> | |
99 </iq> | |
100 | |
101 Romeo receives: | |
102 <iq from="pubsub.localhost" id="config-on_sub" type="result"/> | |
103 | |
104 Juliet sends: | |
105 <iq type="set" to="pubsub.localhost" id='sub2'> | |
106 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
107 <subscribe node="princely_musings" jid="${Juliet's full JID}"/> | |
108 </pubsub> | |
109 </iq> | |
110 | |
111 Juliet receives: | |
112 <iq type="result" id='sub2'/> | |
113 | |
114 Juliet receives: | |
115 <message type="headline" from="pubsub.localhost"> | |
116 <event xmlns="http://jabber.org/protocol/pubsub#event"> | |
117 <items node="princely_musings"> | |
118 <item id="current" publisher="${Romeo's JID}"> | |
119 <entry xmlns="http://www.w3.org/2005/Atom"> | |
120 <title>Soliloquy</title> | |
121 <summary>Lorem ipsum dolor sit amet</summary> | |
122 </entry> | |
123 </item> | |
124 </items> | |
125 </event> | |
126 </message> | |
127 | |
128 Juliet sends: | |
129 <iq type="set" to="pubsub.localhost" id='unsub2'> | |
130 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
131 <unsubscribe node="princely_musings" jid="${Juliet's full JID}"/> | |
132 </pubsub> | |
133 </iq> | |
134 | |
135 Juliet receives: | |
136 <iq type="result" id='unsub2'/> | |
137 | |
138 Juliet disconnects | |
139 | |
140 Romeo sends: | |
141 <iq type="set" to="pubsub.localhost" id='del1'> | |
142 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
143 <delete node="princely_musings"/> | |
144 </pubsub> | |
145 </iq> | |
146 | |
147 Romeo receives: | |
148 <iq type="result" id='del1'/> | |
149 | |
150 Romeo disconnects | |
151 | |
152 // vim: syntax=xml: |