Software /
code /
prosody
Diff
plugins/mod_external_services.lua @ 11037:936ee55e1ae3
mod_external_services: Support adding services via items API
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 25 Jul 2020 10:22:37 +0200 |
parent | 11036:79e410cd7f6e |
child | 11038:efefdf71373b |
line wrap: on
line diff
--- a/plugins/mod_external_services.lua Sat Jul 18 15:36:25 2020 +0200 +++ b/plugins/mod_external_services.lua Sat Jul 25 10:22:37 2020 +0200 @@ -105,7 +105,8 @@ 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 @@ 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)