[Standards] Proposed XMPP Extension: Atomically Compare-And-Publish PubSub Items

Kim Alvefur zash at zash.se
Thu Aug 24 20:40:43 UTC 2017


On Thu, Aug 24, 2017 at 12:10:33PM -0000, Jonas Wielicki wrote:
> Title: Atomically Compare-And-Publish PubSub Items
> Abstract:
> This specification provides a mechanism to atomically Compare-And-
> Publish items to a PubSub node.

Why not define this as a publish-options field?

Eg something like this:

``` xml
<iq type="set" from="hamlet at denmark.lit/blogbot" to="pubsub.shakespeare.lit" id="pub1">
	<pubsub xmlns="http://jabber.org/protocol/pubsub">
		<publish node="princely_musings">
			<item id="2">
				<entry xmlns="http://www.w3.org/2005/Atom">
To be, or not to be: that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles,
And by opposing end them?
					<link rel="alternate" type="text/html" href="http://denmark.lit/2003/12/13/atom03"/>
			<x xmlns="jabber:x:data" type="submit">
				<field var="FORM_TYPE" type="hidden">
				<field var="urn:xmpp:pubsub:cap:0#previd">

Since publish-options is defined such that you can register fields in it
as preconditions, having a precondition on the previous last ID seems
fairly natural.

Kim "Zash" Alvefur

More information about the Standards mailing list