Changeset

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 6433:b93402cec1c4
children 6435:689cb04ff9fd
files plugins/mod_pubsub/mod_pubsub.lua plugins/mod_pubsub/pubsub.lib.lua
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub/mod_pubsub.lua	Fri Sep 26 17:16:46 2014 +0100
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Sat Sep 27 19:53:39 2014 +0200
@@ -100,7 +100,7 @@
 		return;
 	end
 
-	for id, item in pairs(ret) do
+	for _, id in ipairs(ret) do
 		reply:tag("item", { jid = module.host, name = id }):up();
 	end
 	event.exists = true;
--- a/plugins/mod_pubsub/pubsub.lib.lua	Fri Sep 26 17:16:46 2014 +0100
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Sat Sep 27 19:53:39 2014 +0200
@@ -42,8 +42,8 @@
 	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