Software /
code /
prosody
Diff
plugins/mod_pep.lua @ 1404:12abd2da8885
mod_pep: Use new style events
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 24 Jun 2009 20:09:44 +0500 |
parent | 1402:34723bbd5acb |
child | 1424:6969ad97ca58 |
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);