mod_pubsub: Transplant pieces of cdcfd93e2f43 from trunk
[prosody.git] / plugins / mod_pubsub / pubsub.lib.lua
index 2b015e34983c7ff3bd6ee9602d145f2e9bcb537d..4e9acd6866e0ce4bbdf4a9f4adc58bb9431dae7c 100644 (file)
@@ -42,8 +42,8 @@ function handlers.get_items(origin, stanza, items, service)
        end
 
        local data = st.stanza("items", { node = node });
-       for _, entry in pairs(results) do
-               data:add_child(entry);
+       for _, id in ipairs(results) do
+               data:add_child(results[id]);
        end
        local reply;
        if data then