Comparison

plugins/mod_disco.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 discomanager_handle = require "core.discomanager".handle; 22 local discomanager_handle = require "core.discomanager".handle;
23 23
24 require "core.discomanager".set("disco", "http://jabber.org/protocol/disco#info"); 24 module:add_feature("http://jabber.org/protocol/disco#info");
25 require "core.discomanager".set("disco", "http://jabber.org/protocol/disco#items"); 25 module:add_feature("http://jabber.org/protocol/disco#items");
26 26
27 module:add_iq_handler({"c2s", "s2sin"}, "http://jabber.org/protocol/disco#info", function (session, stanza) 27 module:add_iq_handler({"c2s", "s2sin"}, "http://jabber.org/protocol/disco#info", function (session, stanza)
28 session.send(discomanager_handle(stanza)); 28 session.send(discomanager_handle(stanza));
29 end); 29 end);
30 module:add_iq_handler({"c2s", "s2sin"}, "http://jabber.org/protocol/disco#items", function (session, stanza) 30 module:add_iq_handler({"c2s", "s2sin"}, "http://jabber.org/protocol/disco#items", function (session, stanza)