Mercurial > prosody-modules
comparison mod_muc_http_auth/mod_muc_http_auth.lua @ 4303:d261233f7ced
Improve UX by providing defaults users expect
author | Seve Ferrer <seve@delape.net> |
---|---|
date | Fri, 18 Dec 2020 15:28:12 +0100 |
parents | bcb2b9adfcde |
children | aec8148df26a |
comparison
equal
deleted
inserted
replaced
4302:c9e1eee6a948 | 4303:d261233f7ced |
---|---|
10 local disabled_for = module:get_option_set("muc_http_auth_disabled_for", nil) | 10 local disabled_for = module:get_option_set("muc_http_auth_disabled_for", nil) |
11 local insecure = module:get_option("muc_http_auth_insecure", false) --For development purposes | 11 local insecure = module:get_option("muc_http_auth_insecure", false) --For development purposes |
12 local authorize_registration = module:get_option("muc_http_auth_authorize_registration", false) | 12 local authorize_registration = module:get_option("muc_http_auth_authorize_registration", false) |
13 | 13 |
14 local function must_be_authorized(room_node) | 14 local function must_be_authorized(room_node) |
15 -- If none or both of these are set, all rooms need authorization | 15 -- If none of these is set, all rooms need authorization |
16 if not enabled_for and not disabled_for then return true; end | 16 if not enabled_for and not disabled_for then return true; end |
17 if enabled_for and disabled_for then return true; end | |
18 | 17 |
19 if enabled_for then return enabled_for:contains(room_node); end | 18 if enabled_for then return enabled_for:contains(room_node); end |
20 if disabled_for then return not disabled_for:contains(room_node); end | 19 if disabled_for then return not disabled_for:contains(room_node); end |
21 end | 20 end |
22 | 21 |