# HG changeset patch # User Florian Zeitz # Date 1371128195 -3600 # Node ID e7b9ba2d0638dc800a7e73d66899ee04f78e8ed9 # Parent 24b044f6e06d0ea45e7ab2fc55dd9695e0e1f630 mod_pep: When a client supplies no id on a published item, reflect our generated id back to it diff -r 24b044f6e06d -r e7b9ba2d0638 plugins/mod_pep.lua --- a/plugins/mod_pep.lua Tue May 21 10:10:28 2013 +0100 +++ b/plugins/mod_pep.lua Thu Jun 13 13:56:35 2013 +0100 @@ -62,7 +62,7 @@ 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 @@ local node = payload.attr.node; payload = payload.tags[1]; if payload and payload.name == "item" then -- - 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;