comparison mod_extdisco/mod_extdisco.lua @ 3603:ec1d25ae6206

mod_extdisco: Reuse xmlns variable
author Kim Alvefur <zash@zash.se>
date Thu, 23 May 2019 17:26:57 +0200
parents e302537a0e4e
children 60df58c5f7dd
comparison
equal deleted inserted replaced
3602:e302537a0e4e 3603:ec1d25ae6206
8 8
9 module:hook("iq-get/host/"..xmlns_extdisco..":services", function (event) 9 module:hook("iq-get/host/"..xmlns_extdisco..":services", function (event)
10 local origin, stanza = event.origin, event.stanza; 10 local origin, stanza = event.origin, event.stanza;
11 local service = stanza:get_child("service", xmlns_extdisco); 11 local service = stanza:get_child("service", xmlns_extdisco);
12 local service_type = service and service.attr.type; 12 local service_type = service and service.attr.type;
13 local reply = st.reply(stanza):tag('services', { xmlns = 'urn:xmpp:extdisco:1' }); 13 local reply = st.reply(stanza):tag("services", { xmlns = xmlns_extdisco });
14 for host, service_info in pairs(services) do 14 for host, service_info in pairs(services) do
15 if not(service_type) or service_info.type == service_type then 15 if not(service_type) or service_info.type == service_type then
16 reply:tag("service", { 16 reply:tag("service", {
17 host = host; 17 host = host;
18 port = service_info.port; 18 port = service_info.port;