Diff

plugins/mod_register.lua @ 8464:1a0b76b07b7a

mod_register: Include the session and its IP address in user-registering event, so that plugins can use this
author Kim Alvefur <zash@zash.se>
date Fri, 08 Dec 2017 19:39:43 +0100
parent 8452:4796fdcb7146
child 8484:f591855f060d
line wrap: on
line diff
--- 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");