diff options
author | Kim Alvefur <zash@zash.se> | 2018-05-21 00:24:50 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-05-21 00:24:50 +0200 |
commit | 2eb76153f9a49c0e9c3c30f70c713476b8f7a88a (patch) | |
tree | 7e00b99f3b3a5de03e4dcef8a149ac9abe41df7e /plugins/mod_pubsub | |
parent | 9c4ad791201b1c4b8d5a8b6a11e31560509f7159 (diff) | |
download | prosody-2eb76153f9a49c0e9c3c30f70c713476b8f7a88a.tar.gz prosody-2eb76153f9a49c0e9c3c30f70c713476b8f7a88a.zip |
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 <message/> stanza for each
> event notification it generates possesses an 'id' attribute with a
> value
Diffstat (limited to 'plugins/mod_pubsub')
-rw-r--r-- | plugins/mod_pubsub/mod_pubsub.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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); |