# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1479474518 -3600
# Node ID 82333dfdfaff6f4e24a52e5746538ff4df71d36c
# Parent  92f771147de8a138f879cd9c455851f9534d5986
mod_admin_telnet: Use the module:send() API for xmpp:ping command

diff -r 92f771147de8 -r 82333dfdfaff plugins/mod_admin_telnet.lua
--- 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";