aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-04-17 14:20:02 +0100
committerMatthew Wild <mwild1@gmail.com>2013-04-17 14:20:02 +0100
commitd138cfd437d5f9df479bf12adebefc9431953de9 (patch)
tree0c90ca4d14ad5a045fe03a72052e3d1f8aa28829 /plugins/mod_pubsub.lua
parentca5bd83c74f92817ae9d97a1bf8ea33f5c63be86 (diff)
parent11233f48157c8e92a5fb77636a3cd09c557d4d48 (diff)
downloadprosody-d138cfd437d5f9df479bf12adebefc9431953de9.tar.gz
prosody-d138cfd437d5f9df479bf12adebefc9431953de9.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_pubsub.lua')
-rw-r--r--plugins/mod_pubsub.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_pubsub.lua b/plugins/mod_pubsub.lua
index 7bd33102..4d3911bb 100644
--- a/plugins/mod_pubsub.lua
+++ b/plugins/mod_pubsub.lua
@@ -190,7 +190,11 @@ function handlers.set_publish(origin, stanza, publish)
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