mod_register: Include the session and its IP address in user-registering event, so that plugins can use this
authorKim Alvefur <zash@zash.se>
Fri, 08 Dec 2017 19:39:43 +0100
changeset 8467 1a0b76b07b7a
parent 8466 d81ebb1ef5ce
child 8470 7269313c1324
mod_register: Include the session and its IP address in user-registering event, so that plugins can use this
plugins/mod_register.lua
--- a/plugins/mod_register.lua	Tue Dec 05 13:24:28 2017 +0100
+++ b/plugins/mod_register.lua	Fri Dec 08 19:39:43 2017 +0100
@@ -274,7 +274,7 @@
 						session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid."));
 						return true;
 					end
-					local user = { username = username , host = host, additional = data, allowed = true }
+					local user = { username = username , 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");