Annotate

plugins/mod_ping.lua @ 519:cccd610a0ef9

Insert copyright/license headers
author Matthew Wild <mwild1@gmail.com>
date Wed, 03 Dec 2008 14:39:07 +0000
parent 438:193f9dd64f17
child 541:3521e0851c9e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
519
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
1 -- Prosody IM v0.1
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
2 -- Copyright (C) 2008 Matthew Wild
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
3 -- Copyright (C) 2008 Waqas Hussain
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
4 --
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
5 -- This program is free software; you can redistribute it and/or
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
6 -- modify it under the terms of the GNU General Public License
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
7 -- as published by the Free Software Foundation; either version 2
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
8 -- of the License, or (at your option) any later version.
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
9 --
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
10 -- This program is distributed in the hope that it will be useful,
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
13 -- GNU General Public License for more details.
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
14 --
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
15 -- You should have received a copy of the GNU General Public License
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
16 -- along with this program; if not, write to the Free Software
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
17 -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
18 --
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
19
cccd610a0ef9 Insert copyright/license headers
Matthew Wild <mwild1@gmail.com>
parents: 438
diff changeset
20
425
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
21
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
22 local st = require "util.stanza";
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
23
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
24 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
25
438
193f9dd64f17 Bumper commit for the new modulemanager API \o/ Updates all the modules, though some more changes may be in store.
Matthew Wild <mwild1@gmail.com>
parents: 427
diff changeset
26 module:add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:ping",
425
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
27 function(session, stanza)
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
28 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
29 session.send(st.reply(stanza));
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
30 end
f3b65866192e Added mod_ping with support for [XEP-0199: XMPP Ping]
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
31 end);