Merge 0.9->trunk
authorMatthew Wild <mwild1@gmail.com>
Wed, 17 Apr 2013 14:20:02 +0100
changeset 5480 415e520e4a4c
parent 5478 de19e6005f1a (current diff)
parent 5479 81c599c7588b (diff)
child 5483 ed10252ee9c3
Merge 0.9->trunk
--- a/plugins/mod_pubsub.lua	Mon Apr 15 21:26:20 2013 +0100
+++ b/plugins/mod_pubsub.lua	Wed Apr 17 14:20:02 2013 +0100
@@ -190,7 +190,11 @@
 		return origin.send(pubsub_error_reply(stanza, "nodeid-required"));
 	end
 	local item = publish:get_child("item");
-	local id = (item and item.attr.id) or uuid_generate();
+	local id = (item and item.attr.id);
+	if not id then
+		id = uuid_generate();
+		item.attr.id = id;
+	end
 	local ok, ret = service:publish(node, stanza.attr.from, id, item);
 	local reply;
 	if ok then