mod_register: Use throttle_max as indicator of limits being enabled, in case min_seconds_between_registrations is not used
authorKim Alvefur <zash@zash.se>
Wed, 02 Nov 2016 13:30:45 +0100
changeset 7713 08f5b483ff00
parent 7712 0af1783d1592
child 7714 c8130995d4d1
mod_register: Use throttle_max as indicator of limits being enabled, in case min_seconds_between_registrations is not used
plugins/mod_register.lua
--- a/plugins/mod_register.lua	Wed Nov 02 13:08:12 2016 +0100
+++ b/plugins/mod_register.lua	Wed Nov 02 13:30:45 2016 +0100
@@ -230,7 +230,7 @@
 					elseif blacklisted_ips[session.ip] or (whitelist_only and not whitelisted_ips[session.ip]) then
 						session.send(st.error_reply(stanza, "cancel", "not-acceptable", "You are not allowed to register an account."));
 						return true;
-					elseif min_seconds_between_registrations and not whitelisted_ips[session.ip] then
+					elseif throttle_max and not whitelisted_ips[session.ip] then
 						if not check_throttle(session.ip) then
 							log("debug", "Registrations over limit for ip %s", session.ip or "?");
 							session.send(st.error_reply(stanza, "wait", "not-acceptable"));