diff options
author | Kim Alvefur <zash@zash.se> | 2016-11-18 14:08:38 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-11-18 14:08:38 +0100 |
commit | 383aa66ca845f5f85684f9a30f8bc0933513fe98 (patch) | |
tree | 1c7608beb920205281e9b27b0ae5d5fc7f103f1c | |
parent | 73d36e3ff9d9957737e584aba2841e3ca4621689 (diff) | |
download | prosody-383aa66ca845f5f85684f9a30f8bc0933513fe98.tar.gz prosody-383aa66ca845f5f85684f9a30f8bc0933513fe98.zip |
mod_admin_telnet: Use the module:send() API for xmpp:ping command
-rw-r--r-- | plugins/mod_admin_telnet.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 088e09dd..c73870f3 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -32,7 +32,6 @@ local has_pposix, pposix = pcall(require, "util.pposix"); local commands = module:shared("commands") local def_env = module:shared("env"); local default_env_mt = { __index = def_env }; -local core_post_stanza = prosody.core_post_stanza; local function redirect_output(_G, session) local env = setmetatable({ print = session.print }, { __index = function (t, k) return rawget(_G, k); end }); @@ -1062,9 +1061,8 @@ def_env.xmpp = {}; local st = require "util.stanza"; function def_env.xmpp:ping(localhost, remotehost) if hosts[localhost] then - core_post_stanza(hosts[localhost], - st.iq{ from=localhost, to=remotehost, type="get", id="ping" } - :tag("ping", {xmlns="urn:xmpp:ping"})); + module:send(st.iq{ from=localhost, to=remotehost, type="get", id="ping" } + :tag("ping", {xmlns="urn:xmpp:ping"}), hosts[localhost]); return true, "Sent ping"; else return nil, "No such host"; |