# HG changeset patch # User Kim Alvefur # Date 1757179515 -7200 # Node ID 2f01497b04c96394e2f83fbc98dc08becb7c3092 # Parent 57cf3fc844f6ad47cbefd9a68af012018189580b mod_block_registrations: Fix indentation diff -r 57cf3fc844f6 -r 2f01497b04c9 mod_block_registrations/mod_block_registrations.lua --- a/mod_block_registrations/mod_block_registrations.lua Sat Sep 06 20:38:46 2025 +0200 +++ b/mod_block_registrations/mod_block_registrations.lua Sat Sep 06 19:25:15 2025 +0200 @@ -11,24 +11,24 @@ local require_pattern = module:get_option_string("block_registrations_require"); function is_blocked(username) - -- Check if the username is simply blocked - if block_users:contains(username) then return true; end + -- Check if the username is simply blocked + if block_users:contains(username) then return true; end - for pattern in block_patterns do - if username:find(pattern) then - return true; - end - end - -- Not blocked, but check that username matches allowed pattern - if require_pattern and not username:match(require_pattern) then - return true; - end + for pattern in block_patterns do + if username:find(pattern) then + return true; + end + end + -- Not blocked, but check that username matches allowed pattern + if require_pattern and not username:match(require_pattern) then + return true; + end end module:hook("user-registering", function(event) - local username = event.username; - if is_blocked(username) then - event.allowed = false; - return true; - end + local username = event.username; + if is_blocked(username) then + event.allowed = false; + return true; + end end, 10);