From 2eb76153f9a49c0e9c3c30f70c713476b8f7a88a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 21 May 2018 00:24:50 +0200 Subject: 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 --- plugins/mod_pubsub/mod_pubsub.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/mod_pubsub') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index e4e0d406..80b1dbae 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -2,6 +2,7 @@ local pubsub = require "util.pubsub"; 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 @@ function simple_broadcast(kind, node, jids, item, actor) 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); -- cgit v1.2.3