Software /
code /
prosody
Changeset
13229:bb7177efbf41
plugins: Use boolean config method in some places
Because it makes sense and improves feedback via logging
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 18 Jul 2023 12:38:16 +0200 |
parents | 13228:616c578c644f |
children | 13230:26c30844cac6 |
files | plugins/mod_storage_sql.lua plugins/mod_tls.lua plugins/muc/mod_muc.lua |
diffstat | 3 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua Tue Jul 18 12:36:47 2023 +0200 +++ b/plugins/mod_storage_sql.lua Tue Jul 18 12:38:16 2023 +0200 @@ -908,7 +908,7 @@ if not engine then module:log("debug", "Creating new engine %s", db_uri); engine = sql:create_engine(params, function (engine) -- luacheck: ignore 431/engine - if module:get_option("sql_manage_tables", true) then + if module:get_option_boolean("sql_manage_tables", true) then -- Automatically create table, ignore failure (table probably already exists) -- FIXME: we should check in information_schema, etc. create_table(engine);
--- a/plugins/mod_tls.lua Tue Jul 18 12:36:47 2023 +0200 +++ b/plugins/mod_tls.lua Tue Jul 18 12:38:16 2023 +0200 @@ -10,10 +10,10 @@ local rawgetopt = require"prosody.core.configmanager".rawget; local st = require "prosody.util.stanza"; -local c2s_require_encryption = module:get_option("c2s_require_encryption", module:get_option("require_encryption", true)); -local s2s_require_encryption = module:get_option("s2s_require_encryption", true); -local allow_s2s_tls = module:get_option("s2s_allow_encryption") ~= false; -local s2s_secure_auth = module:get_option("s2s_secure_auth"); +local c2s_require_encryption = module:get_option_boolean("c2s_require_encryption", module:get_option_boolean("require_encryption", true)); +local s2s_require_encryption = module:get_option_boolean("s2s_require_encryption", true); +local allow_s2s_tls = module:get_option_boolean("s2s_allow_encryption", true); +local s2s_secure_auth = module:get_option_boolean("s2s_secure_auth", false); if s2s_secure_auth and s2s_require_encryption == false then module:log("warn", "s2s_secure_auth implies s2s_require_encryption, but s2s_require_encryption is set to false");
--- a/plugins/muc/mod_muc.lua Tue Jul 18 12:36:47 2023 +0200 +++ b/plugins/muc/mod_muc.lua Tue Jul 18 12:38:16 2023 +0200 @@ -282,11 +282,9 @@ room:set_public(module:get_option_boolean("muc_room_default_public", false)); room:set_persistent(module:get_option_boolean("muc_room_default_persistent", room:get_persistent())); room:set_members_only(module:get_option_boolean("muc_room_default_members_only", room:get_members_only())); - room:set_allow_member_invites(module:get_option_boolean("muc_room_default_allow_member_invites", - room:get_allow_member_invites())); + room:set_allow_member_invites(module:get_option_boolean("muc_room_default_allow_member_invites", room:get_allow_member_invites())); room:set_moderated(module:get_option_boolean("muc_room_default_moderated", room:get_moderated())); - room:set_whois(module:get_option_boolean("muc_room_default_public_jids", - room:get_whois() == "anyone") and "anyone" or "moderators"); + room:set_whois(module:get_option_boolean("muc_room_default_public_jids", room:get_whois() == "anyone") and "anyone" or "moderators"); room:set_changesubject(module:get_option_boolean("muc_room_default_change_subject", room:get_changesubject())); room:set_historylength(module:get_option_integer("muc_room_default_history_length", room:get_historylength(), 0)); room:set_language(lang or module:get_option_string("muc_room_default_language"));