diff options
author | Kim Alvefur <zash@zash.se> | 2020-04-23 19:02:44 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-04-23 19:02:44 +0200 |
commit | 7e72aa8bc59a93d88e3b87cbe3ddb61933b0b215 (patch) | |
tree | 4315c3ae64a57199c3b9f9c1fc7ba83cbf698817 /plugins/mod_register_ibr.lua | |
parent | ed34a5f4764715ddd4362f40d856ece4ec1f17f2 (diff) | |
download | prosody-7e72aa8bc59a93d88e3b87cbe3ddb61933b0b215.tar.gz prosody-7e72aa8bc59a93d88e3b87cbe3ddb61933b0b215.zip |
mod_register_ibr: Fix reporting of registration rejection reason
When the reason is reported as an util.error object the `reason` field
is empty and the reason text should be extacted from the error object.
Diffstat (limited to 'plugins/mod_register_ibr.lua')
-rw-r--r-- | plugins/mod_register_ibr.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_register_ibr.lua b/plugins/mod_register_ibr.lua index 6de9bc33..e79fc763 100644 --- a/plugins/mod_register_ibr.lua +++ b/plugins/mod_register_ibr.lua @@ -167,7 +167,6 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event) local user = { username = username, password = password, host = host, additional = data, ip = session.ip, session = session, allowed = true } module:fire_event("user-registering", user); if not user.allowed then - log("debug", "Registration disallowed by module: %s", user.reason or "no reason given"); local error_type, error_condition, reason; local err = user.error; if err then @@ -176,6 +175,7 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event) -- COMPAT pre-util.error error_type, error_condition, reason = user.error_type, user.error_condition, user.reason; end + log("debug", "Registration disallowed by module: %s", reason or "no reason given"); session.send(st.error_reply(stanza, error_type or "modify", error_condition or "not-acceptable", reason)); return true; end |