aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-07-25 10:22:37 +0200
committerKim Alvefur <zash@zash.se>2020-07-25 10:22:37 +0200
commitdfe8d1428412e32ab7f275adc1a6f458952e8596 (patch)
tree5f454206b2e8d771106778ad3b59162e97766ed8
parent117b53efe5cf5a9b2c2f2da3abb0bcda0cc9aa05 (diff)
downloadprosody-dfe8d1428412e32ab7f275adc1a6f458952e8596.tar.gz
prosody-dfe8d1428412e32ab7f275adc1a6f458952e8596.zip
mod_external_services: Support adding services via items API
-rw-r--r--plugins/mod_external_services.lua6
1 files 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)