aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2013-06-13 13:56:35 +0100
committerFlorian Zeitz <florob@babelmonkeys.de>2013-06-13 13:56:35 +0100
commit0f3ff365c620b8005f82ac890859c04d8cf95c11 (patch)
tree4a2470eef1e3ad295e316e9326ce89ad9e95990c
parent3a0a66721eeb70cfe0d4e1b500e946f24e4104ea (diff)
downloadprosody-0f3ff365c620b8005f82ac890859c04d8cf95c11.tar.gz
prosody-0f3ff365c620b8005f82ac890859c04d8cf95c11.zip
mod_pep: When a client supplies no id on a published item, reflect our generated id back to it
-rw-r--r--plugins/mod_pep.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index a65ee903..e88bfd9f 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -62,7 +62,7 @@ local function publish(session, node, id, item)
end
else
if not user_data then user_data = {}; data[bare] = user_data; end
- user_data[node] = {id or "1", item};
+ user_data[node] = {id, item};
end
-- broadcast
@@ -169,7 +169,8 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event)
local node = payload.attr.node;
payload = payload.tags[1];
if payload and payload.name == "item" then -- <item>
- local id = payload.attr.id;
+ local id = payload.attr.id or "1";
+ payload.attr.id = id;
session.send(st.reply(stanza));
publish(session, node, id, st.clone(payload));
return true;