From 5afc65ca37cf958850d318918043f306dbc92b12 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 10 Apr 2017 10:28:05 +0200 Subject: mod_register: Remove check for empty table (previous line sets a field) --- plugins/mod_register.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_register.lua') diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 72e91368..58aa1536 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -268,7 +268,7 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event) local error_reply = st.error_reply(stanza, "wait", "internal-server-error", "Failed to write data to disk."); if usermanager_create_user(username, password, host) then data.registered = os.time(); - if next(data) and not account_details:set(username, data) then + if not account_details:set(username, data) then log("debug", "Could not store extra details"); usermanager_delete_user(username, host); session.send(error_reply); -- cgit v1.2.3 From 3dad4dc1001d0a0405c3e443b1b7e161c8536152 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 10 Apr 2017 10:30:31 +0200 Subject: mod_register: Include additional data in user-registering event --- plugins/mod_register.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_register.lua') diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 58aa1536..e999428d 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -255,7 +255,7 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event) session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid.")); return true; end - local user = { username = username , host = host, allowed = true } + local user = { username = username , host = host, additional = data, allowed = true } module:fire_event("user-registering", user); if not user.allowed then log("debug", "Registration disallowed by module"); -- cgit v1.2.3