Changeset

4640:d835cb7d2b47

mod_bookmarks2: Update namespace to :1
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 30 Jul 2021 21:17:09 +0200
parents 4639:3da7cd77aca9
children 4641:64fafbeba14d
files mod_bookmarks2/mod_bookmarks2.lua mod_bookmarks2/tests/bookmarks2.scs mod_bookmarks2/tests/conversion.scs
diffstat 3 files changed, 35 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/mod_bookmarks2/mod_bookmarks2.lua	Fri Jul 30 21:13:16 2021 +0200
+++ b/mod_bookmarks2/mod_bookmarks2.lua	Fri Jul 30 21:17:09 2021 +0200
@@ -9,7 +9,7 @@
 local mod_pep = module:depends "pep";
 local private_storage = module:open_store("private", "map");
 
-local namespace = "urn:xmpp:bookmarks:0";
+local namespace = "urn:xmpp:bookmarks:1";
 
 local default_options = {
 	["persist_items"] = true;
--- a/mod_bookmarks2/tests/bookmarks2.scs	Fri Jul 30 21:13:16 2021 +0200
+++ b/mod_bookmarks2/tests/bookmarks2.scs	Fri Jul 30 21:17:09 2021 +0200
@@ -11,39 +11,40 @@
 Juliet connects
 
 -- Generated with https://gitlab.com/xmpp-rs/xmpp-parsers:
--- cargo run --example=generate-caps https://code.matthewwild.co.uk/scansion/ <<< "<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='scansion' type='bot'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='urn:xmpp:bookmarks:0+notify'/></query>"
+-- cargo run --example=generate-caps https://code.matthewwild.co.uk/scansion/ <<< "<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='scansion' type='bot'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='urn:xmpp:bookmarks:1+notify'/></query>"
 Juliet sends:
 	<presence id='presence0'>
 		<c xmlns='http://jabber.org/protocol/caps'
 		   hash='sha-1'
 		   node='https://code.matthewwild.co.uk/scansion/'
-		   ver='Tg9qGTn5+LdKR6TTdjCUMVohBMc='/>
+		   ver='CPuQARM1gCTq2f6/ZjHUzWL2QHg='/>
 		<c xmlns='urn:xmpp:caps'>
-			<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>5a5oTk21S9EmWQGIyuMwPKuSkPwqmXv6aKO5ftqCw/Q=</hash>
-			<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>f3ziwT4vDK+VxuWrhhPEEgI3HJcEw7Zg4MggYE6vjZ0=</hash>
+			<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>OTy9GPCvBZRvqzOHmD/ThA1WbBH3tNoeKbdqKQCRPHc=</hash>
+			<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>f/rxDeTf6HyjQ382V3GEG/UfAs5IeclC05jBSBnVQCI=</hash>
+			<hash xmlns='urn:xmpp:hashes:2' algo='blake2b-256'>ucfqg/NrLj0omE+26hYMrbpcmxHcU4Z3hfAQIF+6tt0=</hash>
 		</c>
 	</presence>
 
 Juliet receives:
 	<iq from="${Juliet's JID}" id='disco' type='get'>
-		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#Tg9qGTn5+LdKR6TTdjCUMVohBMc='/>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#CPuQARM1gCTq2f6/ZjHUzWL2QHg='/>
 	</iq>
 
 Juliet sends:
 	<iq to="${Juliet's JID}" id='disco' type='result'>
-		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#Tg9qGTn5+LdKR6TTdjCUMVohBMc='>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#CPuQARM1gCTq2f6/ZjHUzWL2QHg='>
 			<identity category='client' name='scansion' type='bot'/>
 			<feature var='http://jabber.org/protocol/disco#info'/>
-			<feature var='urn:xmpp:bookmarks:0+notify'/>
+			<feature var='urn:xmpp:bookmarks:1+notify'/>
 		</query>
 	</iq>
 
 Juliet sends:
 	<iq type='set' id='pub0'>
 		<pubsub xmlns='http://jabber.org/protocol/pubsub'>
-			<publish node='urn:xmpp:bookmarks:0'>
+			<publish node='urn:xmpp:bookmarks:1'>
 				<item id='theplay@conference.shakespeare.lit'>
-					<conference xmlns='urn:xmpp:bookmarks:0'
+					<conference xmlns='urn:xmpp:bookmarks:1'
 					            name='The Play&apos;s the Thing'
 					            autojoin='true'>
 						<nick>JC</nick>
@@ -75,9 +76,9 @@
 Juliet receives:
 	<message type='headline' from="${Juliet's JID}">
 		<event xmlns='http://jabber.org/protocol/pubsub#event'>
-			<items node='urn:xmpp:bookmarks:0'>
+			<items node='urn:xmpp:bookmarks:1'>
 				<item id='theplay@conference.shakespeare.lit'>
-					<conference xmlns='urn:xmpp:bookmarks:0'
+					<conference xmlns='urn:xmpp:bookmarks:1'
 					            name='The Play&apos;s the Thing'
 					            autojoin='true'>
 						<nick>JC</nick>
@@ -90,7 +91,7 @@
 Juliet receives:
 	<iq type='result' id='pub0'>
 		<pubsub xmlns='http://jabber.org/protocol/pubsub'>
-			<publish node='urn:xmpp:bookmarks:0'>
+			<publish node='urn:xmpp:bookmarks:1'>
 				<item id='theplay@conference.shakespeare.lit'/>
 			</publish>
 		</pubsub>
@@ -99,9 +100,9 @@
 Juliet sends:
 	<iq type='set' id='pub1'>
 		<pubsub xmlns='http://jabber.org/protocol/pubsub'>
-			<publish node='urn:xmpp:bookmarks:0'>
+			<publish node='urn:xmpp:bookmarks:1'>
 				<item id='orchard@conference.shakespeare.lit'>
-					<conference xmlns='urn:xmpp:bookmarks:0'
+					<conference xmlns='urn:xmpp:bookmarks:1'
 					            name='The Orchard'
 					            autojoin='true'>
 						<nick>JC</nick>
@@ -133,9 +134,9 @@
 Juliet receives:
 	<message type='headline' from="${Juliet's JID}">
 		<event xmlns='http://jabber.org/protocol/pubsub#event'>
-			<items node='urn:xmpp:bookmarks:0'>
+			<items node='urn:xmpp:bookmarks:1'>
 				<item id='orchard@conference.shakespeare.lit'>
-					<conference xmlns='urn:xmpp:bookmarks:0'
+					<conference xmlns='urn:xmpp:bookmarks:1'
 					            name='The Orchard'
 					            autojoin='true'>
 						<nick>JC</nick>
@@ -148,7 +149,7 @@
 Juliet receives:
 	<iq type='result' id='pub1'>
 		<pubsub xmlns='http://jabber.org/protocol/pubsub'>
-			<publish node='urn:xmpp:bookmarks:0'>
+			<publish node='urn:xmpp:bookmarks:1'>
 				<item id='orchard@conference.shakespeare.lit'/>
 			</publish>
 		</pubsub>
@@ -157,7 +158,7 @@
 Juliet sends:
 	<iq type='set' id='retract0'>
 		<pubsub xmlns='http://jabber.org/protocol/pubsub'>
-			<retract node='urn:xmpp:bookmarks:0' notify='1'>
+			<retract node='urn:xmpp:bookmarks:1' notify='1'>
 				<item id='theplay@conference.shakespeare.lit'/>
 			</retract>
 		</pubsub>
@@ -166,7 +167,7 @@
 Juliet receives:
 	<message type='headline' from="${Juliet's JID}">
 		<event xmlns='http://jabber.org/protocol/pubsub#event'>
-			<items node='urn:xmpp:bookmarks:0'>
+			<items node='urn:xmpp:bookmarks:1'>
 				<retract id='theplay@conference.shakespeare.lit'/>
 			</items>
 		</event>
--- a/mod_bookmarks2/tests/conversion.scs	Fri Jul 30 21:13:16 2021 +0200
+++ b/mod_bookmarks2/tests/conversion.scs	Fri Jul 30 21:17:09 2021 +0200
@@ -15,30 +15,31 @@
 Juliet-new connects
 
 -- Generated with https://gitlab.com/xmpp-rs/xmpp-parsers:
--- cargo run --example=generate-caps https://code.matthewwild.co.uk/scansion/ <<< "<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='scansion' type='bot'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='urn:xmpp:bookmarks:0+notify'/></query>"
+-- cargo run --example=generate-caps https://code.matthewwild.co.uk/scansion/ <<< "<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='scansion' type='bot'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='urn:xmpp:bookmarks:1+notify'/></query>"
 Juliet-new sends:
 	<presence id='presence0'>
 		<c xmlns='http://jabber.org/protocol/caps'
 		   hash='sha-1'
 		   node='https://code.matthewwild.co.uk/scansion/'
-		   ver='Tg9qGTn5+LdKR6TTdjCUMVohBMc='/>
+		   ver='CPuQARM1gCTq2f6/ZjHUzWL2QHg='/>
 		<c xmlns='urn:xmpp:caps'>
-			<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>5a5oTk21S9EmWQGIyuMwPKuSkPwqmXv6aKO5ftqCw/Q=</hash>
-			<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>f3ziwT4vDK+VxuWrhhPEEgI3HJcEw7Zg4MggYE6vjZ0=</hash>
+			<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>OTy9GPCvBZRvqzOHmD/ThA1WbBH3tNoeKbdqKQCRPHc=</hash>
+			<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>f/rxDeTf6HyjQ382V3GEG/UfAs5IeclC05jBSBnVQCI=</hash>
+			<hash xmlns='urn:xmpp:hashes:2' algo='blake2b-256'>ucfqg/NrLj0omE+26hYMrbpcmxHcU4Z3hfAQIF+6tt0=</hash>
 		</c>
 	</presence>
 
 Juliet-new receives:
 	<iq from="${Juliet-new's JID}" id='disco' type='get'>
-		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#Tg9qGTn5+LdKR6TTdjCUMVohBMc='/>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#CPuQARM1gCTq2f6/ZjHUzWL2QHg='/>
 	</iq>
 
 Juliet-new sends:
 	<iq to="${Juliet-new's JID}" id='disco' type='result'>
-		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#Tg9qGTn5+LdKR6TTdjCUMVohBMc='>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#CPuQARM1gCTq2f6/ZjHUzWL2QHg='>
 			<identity category='client' name='scansion' type='bot'/>
 			<feature var='http://jabber.org/protocol/disco#info'/>
-			<feature var='urn:xmpp:bookmarks:0+notify'/>
+			<feature var='urn:xmpp:bookmarks:1+notify'/>
 		</query>
 	</iq>
 
@@ -74,9 +75,9 @@
 Juliet-new receives:
 	<message type='headline' from="${Juliet-new's JID}">
 		<event xmlns='http://jabber.org/protocol/pubsub#event'>
-			<items node='urn:xmpp:bookmarks:0'>
+			<items node='urn:xmpp:bookmarks:1'>
 				<item id='theplay@conference.shakespeare.lit'>
-					<conference xmlns='urn:xmpp:bookmarks:0'
+					<conference xmlns='urn:xmpp:bookmarks:1'
 					            name='The Play&apos;s the Thing'
 					            autojoin='true'>
 						<nick>JC</nick>
@@ -130,9 +131,9 @@
 Juliet-new receives:
 	<message type='headline' from="${Juliet-new's JID}">
 		<event xmlns='http://jabber.org/protocol/pubsub#event'>
-			<items node='urn:xmpp:bookmarks:0'>
+			<items node='urn:xmpp:bookmarks:1'>
 				<item id='orchard@conference.shakespeare.lit'>
-					<conference xmlns='urn:xmpp:bookmarks:0'
+					<conference xmlns='urn:xmpp:bookmarks:1'
 					            name='The Orchard'
 					            autojoin='true'>
 						<nick>JC</nick>
@@ -186,7 +187,7 @@
 Juliet-new receives:
 	<message type='headline' from="${Juliet-new's JID}">
 		<event xmlns='http://jabber.org/protocol/pubsub#event'>
-			<items node='urn:xmpp:bookmarks:0'>
+			<items node='urn:xmpp:bookmarks:1'>
 				<retract id='theplay@conference.shakespeare.lit'/>
 			</items>
 		</event>
@@ -225,7 +226,7 @@
 Juliet-new receives:
 	<message type='headline' from="${Juliet-new's JID}">
 		<event xmlns='http://jabber.org/protocol/pubsub#event'>
-			<purge node='urn:xmpp:bookmarks:0'/>
+			<purge node='urn:xmpp:bookmarks:1'/>
 		</event>
 	</message>