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
commit6dfae9bbfa4b60374a52482bdf60355acafd5a6a (patch)
tree5f454206b2e8d771106778ad3b59162e97766ed8
parentb289d05cfbde014799fcf66fec36895bee5be071 (diff)
downloadprosody-6dfae9bbfa4b60374a52482bdf60355acafd5a6a.tar.gz
prosody-6dfae9bbfa4b60374a52482bdf60355acafd5a6a.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)