Annotate

plugins/mod_ping.lua @ 427:3288dd8d9669

Yes, we don't put these things in here, we put them in here.
author Matthew Wild <mwild1@gmail.com>
date Wed, 26 Nov 2008 15:58:04 +0000
parent 425:util/mod_ping.lua@f3b65866192e
child 438:193f9dd64f17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
425
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
1
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
2 local st = require "util.stanza";
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
3
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
4 require "core.discomanager".set("ping", "urn:xmpp:ping");
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
5
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
6 add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:ping",
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
7 function(session, stanza)
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
8 if stanza.attr.type == "get" then
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
9 session.send(st.reply(stanza));
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
10 end
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
11 end);