mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 21:57:45 +03:00
plugins: Use boolean config method in some places
Because it makes sense and improves feedback via logging
This commit is contained in:
parent
41ea0ee4a4
commit
91d95d4c33
3 changed files with 7 additions and 9 deletions
|
@ -908,7 +908,7 @@ function module.load()
|
||||||
if not engine then
|
if not engine then
|
||||||
module:log("debug", "Creating new engine %s", db_uri);
|
module:log("debug", "Creating new engine %s", db_uri);
|
||||||
engine = sql:create_engine(params, function (engine) -- luacheck: ignore 431/engine
|
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)
|
-- Automatically create table, ignore failure (table probably already exists)
|
||||||
-- FIXME: we should check in information_schema, etc.
|
-- FIXME: we should check in information_schema, etc.
|
||||||
create_table(engine);
|
create_table(engine);
|
||||||
|
|
|
@ -10,10 +10,10 @@ local create_context = require "prosody.core.certmanager".create_context;
|
||||||
local rawgetopt = require"prosody.core.configmanager".rawget;
|
local rawgetopt = require"prosody.core.configmanager".rawget;
|
||||||
local st = require "prosody.util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local c2s_require_encryption = module:get_option("c2s_require_encryption", module:get_option("require_encryption", true));
|
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("s2s_require_encryption", true);
|
local s2s_require_encryption = module:get_option_boolean("s2s_require_encryption", true);
|
||||||
local allow_s2s_tls = module:get_option("s2s_allow_encryption") ~= false;
|
local allow_s2s_tls = module:get_option_boolean("s2s_allow_encryption", true);
|
||||||
local s2s_secure_auth = module:get_option("s2s_secure_auth");
|
local s2s_secure_auth = module:get_option_boolean("s2s_secure_auth", false);
|
||||||
|
|
||||||
if s2s_secure_auth and s2s_require_encryption == false then
|
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");
|
module:log("warn", "s2s_secure_auth implies s2s_require_encryption, but s2s_require_encryption is set to false");
|
||||||
|
|
|
@ -282,11 +282,9 @@ local function set_room_defaults(room, lang)
|
||||||
room:set_public(module:get_option_boolean("muc_room_default_public", false));
|
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_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_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:set_allow_member_invites(module:get_option_boolean("muc_room_default_allow_member_invites", room:get_allow_member_invites()));
|
||||||
room:get_allow_member_invites()));
|
|
||||||
room:set_moderated(module:get_option_boolean("muc_room_default_moderated", room:get_moderated()));
|
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:set_whois(module:get_option_boolean("muc_room_default_public_jids", room:get_whois() == "anyone") and "anyone" or "moderators");
|
||||||
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_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_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"));
|
room:set_language(lang or module:get_option_string("muc_room_default_language"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue