# HG changeset patch # User Waqas Hussain # Date 1245856184 -18000 # Node ID 12abd2da888539f989a6e361b821c9c5dbe75858 # Parent a1762cfd4d834b0069ee01b83bc4b24f8b5e30f4 mod_pep: Use new style events diff -r a1762cfd4d83 -r 12abd2da8885 plugins/mod_pep.lua --- 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 -- @@ -88,6 +89,5 @@ end -- TODO else error end end - session.send(st.error_reply(stanza, "cancel", "service-unavailable")); end);