# HG changeset patch # User Kim Alvefur # Date 1587661364 -7200 # Node ID a0166932479f15704c7828119c440b12f96ab14a # Parent 00d2a577204c9cce7ec7079a386fc1dcc44ffd51 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. diff -r 00d2a577204c -r a0166932479f plugins/mod_register_ibr.lua --- a/plugins/mod_register_ibr.lua Thu Apr 23 19:00:48 2020 +0200 +++ b/plugins/mod_register_ibr.lua Thu Apr 23 19:02:44 2020 +0200 @@ -167,7 +167,6 @@ 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 @@ -- 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