aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-11-26 09:06:32 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-11-26 09:06:32 +0500
commitd0481af8e07fbbc49b586680511cdd94525eb01e (patch)
tree192e431446efabfd41aebbe2d4e0230c36526616
parentc3404c96e21bdacc09a33912d547b23c7e3119ae (diff)
downloadprosody-d0481af8e07fbbc49b586680511cdd94525eb01e.tar.gz
prosody-d0481af8e07fbbc49b586680511cdd94525eb01e.zip
Added mod_ping with support for [XEP-0199: XMPP Ping]
-rw-r--r--util/mod_ping.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/mod_ping.lua b/util/mod_ping.lua
new file mode 100644
index 00000000..c13282ff
--- /dev/null
+++ b/util/mod_ping.lua
@@ -0,0 +1,11 @@
+
+local st = require "util.stanza";
+
+require "core.discomanager".set("ping", "urn:xmpp:ping");
+
+add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:ping",
+ function(session, stanza)
+ if stanza.attr.type == "get" then
+ session.send(st.reply(stanza));
+ end
+ end);