# HG changeset patch # User Kim Alvefur # Date 1526855090 -7200 # Node ID f2d35eee69c958f07ce9d5130f2dff3cbbebff87 # Parent 9f8a746f99c1d684b6d471b7bbd6f4565488b1f5 mod_pubsub: Set an id attribute on outgoing event messages https://xmpp.org/extensions/xep-0060.html#impl-bounce > a pubsub service SHOULD ensure that the stanza for each > event notification it generates possesses an 'id' attribute with a > value diff -r 9f8a746f99c1 -r f2d35eee69c9 plugins/mod_pubsub/mod_pubsub.lua --- a/plugins/mod_pubsub/mod_pubsub.lua Sun May 20 15:21:57 2018 +0200 +++ b/plugins/mod_pubsub/mod_pubsub.lua Mon May 21 00:24:50 2018 +0200 @@ -2,6 +2,7 @@ local st = require "util.stanza"; local jid_bare = require "util.jid".bare; local usermanager = require "core.usermanager"; +local new_id = require "util.id".medium; local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event"; @@ -48,7 +49,9 @@ item.attr.publisher = actor end end - local message = st.message({ from = module.host, type = "headline" }) + + local id = new_id(); + local message = st.message({ from = module.host, type = "headline", id = id }) :tag("event", { xmlns = xmlns_pubsub_event }) :tag(kind, { node = node }) :add_child(item);