comparison plugins/mod_pubsub/pubsub.lib.lua @ 6434:382e03a40dd2

mod_pubsub: Transplant pieces of cdcfd93e2f43 from trunk
author Kim Alvefur <zash@zash.se>
date Sat, 27 Sep 2014 19:53:39 +0200
parents 8416d4619d80
children b1c40054b59d
comparison
equal deleted inserted replaced
6433:b93402cec1c4 6434:382e03a40dd2
40 if not ok then 40 if not ok then
41 return origin.send(pubsub_error_reply(stanza, results)); 41 return origin.send(pubsub_error_reply(stanza, results));
42 end 42 end
43 43
44 local data = st.stanza("items", { node = node }); 44 local data = st.stanza("items", { node = node });
45 for _, entry in pairs(results) do 45 for _, id in ipairs(results) do
46 data:add_child(entry); 46 data:add_child(results[id]);
47 end 47 end
48 local reply; 48 local reply;
49 if data then 49 if data then
50 reply = st.reply(stanza) 50 reply = st.reply(stanza)
51 :tag("pubsub", { xmlns = xmlns_pubsub }) 51 :tag("pubsub", { xmlns = xmlns_pubsub })