Software / code / prosody
Comparison
plugins/mod_pubsub/pubsub.lib.lua @ 5851:cdcfd93e2f43
mod_pubsub, util.pubsub: Keep track of the order of items
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 04 Oct 2013 16:40:27 +0200 |
| parent | 5626:8416d4619d80 |
| child | 6438:b1c40054b59d |
comparison
equal
deleted
inserted
replaced
| 5850:e8c743f4213f | 5851:cdcfd93e2f43 |
|---|---|
| 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 }) |