# HG changeset patch # User Kim Alvefur # Date 1514331861 -3600 # Node ID 95706e0f19fcc3b75467c5c11cb01412e601f818 # Parent 91f6815de26a7abe72c82032db6acaa2e59b5490 mod_register_ibr: Allow modules that do pre-registration checks to specify a reason for rejection The current hardcoded text may not always be accurate diff -r 91f6815de26a -r 95706e0f19fc plugins/mod_register_ibr.lua --- a/plugins/mod_register_ibr.lua Wed Dec 27 00:42:57 2017 +0100 +++ b/plugins/mod_register_ibr.lua Wed Dec 27 00:44:21 2017 +0100 @@ -147,7 +147,7 @@ module:fire_event("user-registering", user); if not user.allowed then log("debug", "Registration disallowed by module"); - session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is forbidden.")); + session.send(st.error_reply(stanza, "modify", "not-acceptable", user.reason)); elseif usermanager_user_exists(username, host) then log("debug", "Attempt to register with existing username"); session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists."));