Diff

plugins/mod_pep.lua @ 5627:0439d1349dc1

mod_disco: Emit events for disco requests, which contain a node, on user accounts
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 17 May 2013 18:35:50 +0200
parent 5170:3eaf4fc58902
child 5683:624b874059bf
line wrap: on
line diff
--- a/plugins/mod_pep.lua	Fri May 17 18:33:32 2013 +0200
+++ b/plugins/mod_pep.lua	Fri May 17 18:35:50 2013 +0200
@@ -262,19 +262,19 @@
 end);
 
 module:hook("account-disco-info", function(event)
-	local stanza = event.stanza;
-	stanza:tag('identity', {category='pubsub', type='pep'}):up();
-	stanza:tag('feature', {var='http://jabber.org/protocol/pubsub#publish'}):up();
+	local reply = event.reply;
+	reply:tag('identity', {category='pubsub', type='pep'}):up();
+	reply:tag('feature', {var='http://jabber.org/protocol/pubsub#publish'}):up();
 end);
 
 module:hook("account-disco-items", function(event)
-	local stanza = event.stanza;
-	local bare = stanza.attr.to;
+	local reply = event.reply;
+	local bare = reply.attr.to;
 	local user_data = data[bare];
 
 	if user_data then
 		for node, _ in pairs(user_data) do
-			stanza:tag('item', {jid=bare, node=node}):up(); -- TODO we need to handle queries to these nodes
+			reply:tag('item', {jid=bare, node=node}):up(); -- TODO we need to handle queries to these nodes
 		end
 	end
 end);