aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-07-17 01:38:54 +0200
committerKim Alvefur <zash@zash.se>2023-07-17 01:38:54 +0200
commit71ad48095d92dd52a415eef499da32f8c27bb7fe (patch)
tree0287ae06ee488c1b62e9e3eccbf4a9ae74b8370d /plugins/muc/mod_muc.lua
parent55768509a3f15b0476289f7a338d02e7233d1926 (diff)
downloadprosody-71ad48095d92dd52a415eef499da32f8c27bb7fe.tar.gz
prosody-71ad48095d92dd52a415eef499da32f8c27bb7fe.zip
plugins: Use integer config API with interval specification where sensible
Many of these fall into a few categories: - util.cache size, must be >= 1 - byte or item counts that logically can't be negative - port numbers that should be in 1..0xffff
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r--plugins/muc/mod_muc.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index b8a0d480..88a2be54 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -159,8 +159,8 @@ local function room_save(room, forced, savestate)
end
end
-local max_rooms = module:get_option_number("muc_max_rooms");
-local max_live_rooms = module:get_option_number("muc_room_cache_size", 100);
+local max_rooms = module:get_option_integer("muc_max_rooms", nil, 0);
+local max_live_rooms = module:get_option_integer("muc_room_cache_size", 100, 1);
local room_hit = module:measure("room_hit", "rate");
local room_miss = module:measure("room_miss", "rate")
@@ -288,7 +288,7 @@ local function set_room_defaults(room, lang)
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_number("muc_room_default_history_length", room:get_historylength()));
+ 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_presence_broadcast(module:get_option("muc_room_default_presence_broadcast", room:get_presence_broadcast()));
end