aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-05-21 00:24:50 +0200
committerKim Alvefur <zash@zash.se>2018-05-21 00:24:50 +0200
commit8221c93baf29539ae134c7e58e559a06ec9877c0 (patch)
tree7e00b99f3b3a5de03e4dcef8a149ac9abe41df7e
parent972335a4b263b9a53404209e4cfd61b5f0e6349a (diff)
downloadprosody-8221c93baf29539ae134c7e58e559a06ec9877c0.tar.gz
prosody-8221c93baf29539ae134c7e58e559a06ec9877c0.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
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua5
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);