Comparison

plugins/muc/history.lib.lua @ 13213:50324f66ca2a

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
author Kim Alvefur <zash@zash.se>
date Mon, 17 Jul 2023 01:38:54 +0200
parent 12977:74b9e05af71e
comparison
equal deleted inserted replaced
13212:3e6e98cc63e9 13213:50324f66ca2a
10 local gettime = os.time; 10 local gettime = os.time;
11 local datetime = require "prosody.util.datetime"; 11 local datetime = require "prosody.util.datetime";
12 local st = require "prosody.util.stanza"; 12 local st = require "prosody.util.stanza";
13 13
14 local default_history_length = 20; 14 local default_history_length = 20;
15 local max_history_length = module:get_option_number("max_history_messages", math.huge); 15 local max_history_length = module:get_option_integer("max_history_messages", math.huge, 0);
16 16
17 local function set_max_history_length(_max_history_length) 17 local function set_max_history_length(_max_history_length)
18 max_history_length = _max_history_length or math.huge; 18 max_history_length = _max_history_length or math.huge;
19 end 19 end
20 20