Mercurial > prosody-modules
comparison mod_query_client_ver/mod_query_client_ver.lua @ 2991:9d205ec1fa00
mod_query_client_ver: Fix check for sessions on the current host
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 04 Apr 2018 16:32:51 +0200 |
| parents | cb8d65b40fb4 |
| children | 5fd9462117cd |
comparison
equal
deleted
inserted
replaced
| 2990:cb8d65b40fb4 | 2991:9d205ec1fa00 |
|---|---|
| 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", "ping", |
| 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.jid == 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 |
| 67 end | 67 end |
| 68 return { info = "Ok, check your logs for results", status = "completed" } | 68 return { info = "Ok, check your logs for results", status = "completed" } |
| 69 end)); | 69 end)); |
