From e1cf1cf3880e871b4d28c6dc18d97eefa0122f32 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 5 Aug 2012 17:18:35 +0100 Subject: hostmanager, mod_disco: Show optional 'name' option from the config in disco#items queries (fixes use-case in #292) (thanks diSabler, mva) --- plugins/mod_disco.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/mod_disco.lua') diff --git a/plugins/mod_disco.lua b/plugins/mod_disco.lua index 6587d435..72c9a34c 100644 --- a/plugins/mod_disco.lua +++ b/plugins/mod_disco.lua @@ -111,8 +111,8 @@ module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(eve if node and node ~= "" then return; end -- TODO fire event? local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#items"); - for jid in pairs(get_children(module.host)) do - reply:tag("item", {jid = jid}):up(); + for jid, name in pairs(get_children(module.host)) do + reply:tag("item", {jid = jid, name = name~=true and name or nil}):up(); end for _, item in ipairs(disco_items) do reply:tag("item", {jid=item[1], name=item[2]}):up(); -- cgit v1.2.3