Software /
code /
prosody
Diff
plugins/mod_admin_telnet.lua @ 7722:82333dfdfaff
mod_admin_telnet: Use the module:send() API for xmpp:ping command
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 18 Nov 2016 14:08:38 +0100 |
parent | 7474:701989ab904f |
child | 7723:488fddf88ffd |
child | 7911:e528d848a185 |
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua Fri Nov 18 10:21:02 2016 +0100 +++ b/plugins/mod_admin_telnet.lua Fri Nov 18 14:08:38 2016 +0100 @@ -32,7 +32,6 @@ 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 @@ 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";