mod_pubsub: Allow itemstore to override item ids
authorKim Alvefur <zash@zash.se>
Thu, 09 Nov 2017 17:22:47 +0100
changeset 8403 518b56d806bd
parent 8402 07443fe9df5b
child 8404 f1923a79c93d
mod_pubsub: Allow itemstore to override item ids
plugins/mod_pubsub/pubsub.lib.lua
--- a/plugins/mod_pubsub/pubsub.lib.lua	Thu Nov 09 17:21:50 2017 +0100
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Thu Nov 09 17:22:47 2017 +0100
@@ -297,6 +297,9 @@
 	local ok, ret = service:publish(node, stanza.attr.from, id, item);
 	local reply;
 	if ok then
+		if type(ok) == "string" then
+			id = ok;
+		end
 		reply = st.reply(stanza)
 			:tag("pubsub", { xmlns = xmlns_pubsub })
 				:tag("publish", { node = node })