# HG changeset patch # User Marco Cirillo # Date 1346001645 0 # Node ID 7e474c7f450a65b34fbd7dc1edd0d388f9d5314e # Parent 9927d88a1b2aa4a77c8a80efad58b6e198b329c1 mod_register_redirect: revert back previous change, as returning origin.send() causes inconsistent behaviour stanza routing/callbacks wise if the request comes from a remote entity. diff -r 9927d88a1b2a -r 7e474c7f450a mod_register_redirect/mod_register_redirect.lua --- a/mod_register_redirect/mod_register_redirect.lua Sun Aug 26 18:56:50 2012 +0200 +++ b/mod_register_redirect/mod_register_redirect.lua Sun Aug 26 17:20:45 2012 +0000 @@ -36,11 +36,11 @@ module:log("error", "This module supports only http/https, mailto or xmpp as URL formats.") module:log("error", "If you want to use personalized instructions without an Out-Of-Band method,") module:log("error", "specify: register_oob = false; -- in your configuration along your banner string (register_text).") - return origin.send(st.error_reply(stanza, "wait", "internal-server-error")) -- bouncing request. + origin.send(st.error_reply(stanza, "wait", "internal-server-error")) ; return true -- bouncing request. end else module:log("error", "Please check your configuration, the URL you specified is invalid") - return origin.send(st.error_reply(stanza, "wait", "internal-server-error")) -- bouncing request. + origin.send(st.error_reply(stanza, "wait", "internal-server-error")) ; return true -- bouncing request. end else if admins_l then @@ -53,14 +53,14 @@ else module:log("error", "Please be sure to, _at the very least_, configure one server administrator either global or hostwise...") module:log("error", "if you want to use this module, or read it's configuration wiki at: http://code.google.com/p/prosody-modules/wiki/mod_register_redirect") - return origin.send(st.error_reply(stanza, "wait", "internal-server-error")) -- bouncing request. + origin.send(st.error_reply(stanza, "wait", "internal-server-error")) ; return true -- bouncing request. end end end elseif inst_text and url and oob then if not url:match("^%w+[:].*$") then module:log("error", "Please check your configuration, the URL specified is not valid.") - return origin.send(st.error_reply(stanza, "wait", "internal-server-error")) -- bouncing request. + origin.send(st.error_reply(stanza, "wait", "internal-server-error")) ; return true -- bouncing request. end end @@ -84,10 +84,11 @@ end if stanza.attr.type == "get" then - return origin.send(reply) + origin.send(reply) else - return origin.send(st.error_reply(stanza, "cancel", "not-authorized")) + origin.send(st.error_reply(stanza, "cancel", "not-authorized")) end + return true end module:hook("stanza/iq/jabber:iq:register:query", reg_redirect, 10)