Software /
code /
prosody
Comparison
plugins/mod_ping.lua @ 541:3521e0851c9e
Change modules to use the new add_feature module API method.
This also fixes the bug causing disco features being added to every disco reply for every host.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 04 Dec 2008 20:16:30 +0500 |
parent | 519:cccd610a0ef9 |
child | 615:4ae3e81513f3 |
comparison
equal
deleted
inserted
replaced
540:ec03f6968fa8 | 541:3521e0851c9e |
---|---|
19 | 19 |
20 | 20 |
21 | 21 |
22 local st = require "util.stanza"; | 22 local st = require "util.stanza"; |
23 | 23 |
24 require "core.discomanager".set("ping", "urn:xmpp:ping"); | 24 module:add_feature("urn:xmpp:ping"); |
25 | 25 |
26 module:add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:ping", | 26 module:add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:ping", |
27 function(session, stanza) | 27 function(session, stanza) |
28 if stanza.attr.type == "get" then | 28 if stanza.attr.type == "get" then |
29 session.send(st.reply(stanza)); | 29 session.send(st.reply(stanza)); |