comparison mod_query_client_ver/mod_query_client_ver.lua @ 2993:1f8220f0c8bf

mod_query_client_ver: Use the module name as adhoc command node (mistakenly not changed after copying from mod_ping)
author Kim Alvefur <zash@zash.se>
date Wed, 04 Apr 2018 16:43:22 +0200
parents 5fd9462117cd
children
comparison
equal deleted inserted replaced
2992:5fd9462117cd 2993:1f8220f0c8bf
56 module:hook("iq-error/host/"..disco_id, function() 56 module:hook("iq-error/host/"..disco_id, function()
57 return true; -- Doesn't reply to disco#info? Weird, but ignore for now. 57 return true; -- Doesn't reply to disco#info? Weird, but ignore for now.
58 end); 58 end);
59 59
60 module:add_item("adhoc", 60 module:add_item("adhoc",
61 module:require "adhoc".new("Query all currently connected clients", "ping", 61 module:require "adhoc".new("Query all currently connected clients", module.name,
62 function (self, data, state) 62 function (self, data, state)
63 for jid, session in pairs(prosody.full_sessions) do 63 for jid, session in pairs(prosody.full_sessions) do
64 if session.host == module.host then 64 if session.host == module.host then
65 session.send(st.iq({ id = version_id, type = "get", from = module.host, to = session.full_jid }):query(xmlns_iq_version)); 65 session.send(st.iq({ id = version_id, type = "get", from = module.host, to = session.full_jid }):query(xmlns_iq_version));
66 end 66 end