Changeset

1404:12abd2da8885

mod_pep: Use new style events
author Waqas Hussain <waqas20@gmail.com>
date Wed, 24 Jun 2009 20:09:44 +0500
parents 1403:a1762cfd4d83
children 1405:19269d278c38
files plugins/mod_pep.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pep.lua	Wed Jun 24 20:05:17 2009 +0500
+++ b/plugins/mod_pep.lua	Wed Jun 24 20:09:44 2009 +0500
@@ -73,7 +73,8 @@
 	end
 end, 10);
 
-module:add_iq_handler("c2s", "http://jabber.org/protocol/pubsub", function (session, stanza)
+module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event)
+	local session, stanza = event.origin, event.stanza;
 	if stanza.attr.type == 'set' and (not stanza.attr.to or jid_bare(stanza.attr.from) == stanza.attr.to) then
 		local payload = stanza.tags[1];
 		if payload.name == 'pubsub' then -- <pubsub xmlns='http://jabber.org/protocol/pubsub'>
@@ -88,6 +89,5 @@
 			end -- TODO else error
 		end
 	end
-	session.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 end);