Mercurial > prosody-hg
comparison plugins/mod_external_services.lua @ 13209:c8d949cf6b09
plugins: Switch to :get_option_period() for time range options
Improves readability ("1 day" vs 86400) and centralizes validation.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 16 Jul 2023 20:49:33 +0200 |
| parents | 74b9e05af71e |
| children | 50324f66ca2a |
comparison
equal
deleted
inserted
replaced
| 13208:a7c6ea1c5308 | 13209:c8d949cf6b09 |
|---|---|
| 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_number("external_service_port"); |
| 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_number("external_service_ttl", 86400); | 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 |
| 17 local access = module:get_option_set("external_service_access", {}); | 17 local access = module:get_option_set("external_service_access", {}); |
| 18 | 18 |
