aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-07-26 02:27:24 +0200
committerKim Alvefur <zash@zash.se>2012-07-26 02:27:24 +0200
commitefbe1587526ef281b0b5661e2828edd59448f5dc (patch)
tree015b566dd69f840c19921e5df69c398ff102a339 /plugins/mod_admin_telnet.lua
parentfac697c2cdde2a98dbbadca2b1dc2685a58c6462 (diff)
downloadprosody-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.lua14
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)