Changeset

13232:e0ab20519ce5

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.
author Kim Alvefur <zash@zash.se>
date Fri, 21 Jul 2023 22:48:54 +0200
parents 13231:6a11d92ae436
children 13233:37d67b5f9768
files plugins/mod_authz_internal.lua plugins/mod_register_ibr.lua
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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));