comparison plugins/mod_external_services.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
parents c8d949cf6b09
children 18f560dcc9e3
comparison
equal deleted inserted replaced
13212:3e6e98cc63e9 13213:50324f66ca2a
6 local jid = require "prosody.util.jid"; 6 local jid = require "prosody.util.jid";
7 local array = require "prosody.util.array"; 7 local array = require "prosody.util.array";
8 local set = require "prosody.util.set"; 8 local set = require "prosody.util.set";
9 9
10 local default_host = module:get_option_string("external_service_host", module.host); 10 local default_host = module:get_option_string("external_service_host", module.host);
11 local default_port = module:get_option_number("external_service_port"); 11 local default_port = module:get_option_integer("external_service_port", nil, 1, 65535);
12 local default_secret = module:get_option_string("external_service_secret"); 12 local default_secret = module:get_option_string("external_service_secret");
13 local default_ttl = module:get_option_period("external_service_ttl", "1 day"); 13 local default_ttl = module:get_option_period("external_service_ttl", "1 day");
14 14
15 local configured_services = module:get_option_array("external_services", {}); 15 local configured_services = module:get_option_array("external_services", {});
16 16