diff options
author | Kim Alvefur <zash@zash.se> | 2012-07-26 02:27:24 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-07-26 02:27:24 +0200 |
commit | efbe1587526ef281b0b5661e2828edd59448f5dc (patch) | |
tree | 015b566dd69f840c19921e5df69c398ff102a339 /plugins/mod_admin_telnet.lua | |
parent | fac697c2cdde2a98dbbadca2b1dc2685a58c6462 (diff) | |
download | prosody-efbe1587526ef281b0b5661e2828edd59448f5dc.tar.gz prosody-efbe1587526ef281b0b5661e2828edd59448f5dc.zip |
mod_admin_telnet: Add xmpp:ping(from, to), useful for initiating s2s connections
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 14 |
1 files changed, 14 insertions, 0 deletions
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) |