plugins: Use get_option_array for some list shaped options
authorKim Alvefur <zash@zash.se>
Fri, 21 Jul 2023 22:48:54 +0200
changeset 13236 e0ab20519ce5
parent 13235 6a11d92ae436
child 13237 37d67b5f9768
plugins: Use get_option_array for some list shaped options Passing something from module:get_option() to ipairs() suggests that the option is a list of some sort.
plugins/mod_authz_internal.lua
plugins/mod_register_ibr.lua
--- a/plugins/mod_authz_internal.lua	Fri Jul 21 18:03:22 2023 +0200
+++ b/plugins/mod_authz_internal.lua	Fri Jul 21 22:48:54 2023 +0200
@@ -90,7 +90,7 @@
 
 -- Process custom roles from config
 
-local custom_roles = module:get_option("custom_roles", {});
+local custom_roles = module:get_option_array("custom_roles", {});
 for n, role_config in ipairs(custom_roles) do
 	local ok, err = pcall(register_role, role_config);
 	if not ok then
--- a/plugins/mod_register_ibr.lua	Fri Jul 21 18:03:22 2023 +0200
+++ b/plugins/mod_register_ibr.lua	Fri Jul 21 22:48:54 2023 +0200
@@ -16,7 +16,7 @@
 local nodeprep = require "prosody.util.encodings".stringprep.nodeprep;
 local util_error = require "prosody.util.error";
 
-local additional_fields = module:get_option("additional_registration_fields", {});
+local additional_fields = module:get_option_array("additional_registration_fields", {});
 local require_encryption = module:get_option_boolean("c2s_require_encryption",
 	module:get_option_boolean("require_encryption", true));