From 6dfae9bbfa4b60374a52482bdf60355acafd5a6a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 25 Jul 2020 10:22:37 +0200 Subject: mod_external_services: Support adding services via items API --- plugins/mod_external_services.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/mod_external_services.lua b/plugins/mod_external_services.lua index 51d2d313..c4762e65 100644 --- a/plugins/mod_external_services.lua +++ b/plugins/mod_external_services.lua @@ -105,7 +105,8 @@ local function handle_services(event) end local reply = st.reply(stanza):tag("services", { xmlns = action.attr.xmlns }); - local services = configured_services / prepare; + local extras = module:get_host_items("external_service"); + local services = ( configured_services + extras ) / prepare; local requested_type = action.attr.type; if requested_type then @@ -149,7 +150,8 @@ local function handle_credentials(event) end local reply = st.reply(stanza):tag("credentials", { xmlns = action.attr.xmlns }); - local services = configured_services / prepare; + local extras = module:get_host_items("external_service"); + local services = ( configured_services + extras ) / prepare; services:filter(function (item) return item.restricted; end) -- cgit v1.2.3