aboutsummaryrefslogtreecommitdiffstats
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
commita6f403360b7064c2f787655f04825b829bb2d78e (patch)
tree015b566dd69f840c19921e5df69c398ff102a339
parent7f3c5bae633adf3d19aef14d545b0fede000c545 (diff)
downloadprosody-a6f403360b7064c2f787655f04825b829bb2d78e.tar.gz
prosody-a6f403360b7064c2f787655f04825b829bb2d78e.zip
mod_admin_telnet: Add xmpp:ping(from, to), useful for initiating s2s connections
-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)