Diff

plugins/mod_pubsub/pubsub.lib.lua @ 8400:518b56d806bd

mod_pubsub: Allow itemstore to override item ids
author Kim Alvefur <zash@zash.se>
date Thu, 09 Nov 2017 17:22:47 +0100
parent 8399:07443fe9df5b
child 8814:07197f29e2b8
line wrap: on
line diff
--- 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 })