From efbe1587526ef281b0b5661e2828edd59448f5dc Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 26 Jul 2012 02:27:24 +0200 Subject: mod_admin_telnet: Add xmpp:ping(from, to), useful for initiating s2s connections --- plugins/mod_admin_telnet.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index b698d200..7b176d73 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -934,6 +934,20 @@ function def_env.user:passwd(jid, password) end end +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"})); + return true, "Sent ping"; + else + return nil, "No such host"; + end +end + ------------- function printbanner(session) -- cgit v1.2.3