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.
This commit is contained in:
Waqas Hussain 2008-12-04 20:16:30 +05:00
parent fcf33a735b
commit 2d2414f199
10 changed files with 12 additions and 12 deletions

View file

@ -21,8 +21,8 @@
local discomanager_handle = require "core.discomanager".handle;
require "core.discomanager".set("disco", "http://jabber.org/protocol/disco#info");
require "core.discomanager".set("disco", "http://jabber.org/protocol/disco#items");
module:add_feature("http://jabber.org/protocol/disco#info");
module:add_feature("http://jabber.org/protocol/disco#items");
module:add_iq_handler({"c2s", "s2sin"}, "http://jabber.org/protocol/disco#info", function (session, stanza)
session.send(discomanager_handle(stanza));

View file

@ -22,7 +22,7 @@
local st = require "util.stanza";
local t_concat = table.concat;
require "core.discomanager".set("legacyauth", "jabber:iq:auth");
module:add_feature("jabber:iq:auth");
module:add_iq_handler("c2s_unauthed", "jabber:iq:auth",
function (session, stanza)

View file

@ -21,7 +21,7 @@
local st = require "util.stanza";
require "core.discomanager".set("ping", "urn:xmpp:ping");
module:add_feature("urn:xmpp:ping");
module:add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:ping",
function(session, stanza)

View file

@ -24,7 +24,7 @@ local st = require "util.stanza"
local jid_split = require "util.jid".split;
local datamanager = require "util.datamanager"
require "core.discomanager".set("private", "jabber:iq:private");
module:add_feature("jabber:iq:private");
module:add_iq_handler("c2s", "jabber:iq:private",
function (session, stanza)

View file

@ -24,7 +24,7 @@ local usermanager_user_exists = require "core.usermanager".user_exists;
local usermanager_create_user = require "core.usermanager".create_user;
local datamanager_store = require "util.datamanager".store;
require "core.discomanager".set("register", "jabber:iq:register");
module:add_feature("jabber:iq:register");
module:add_iq_handler("c2s", "jabber:iq:register", function (session, stanza)
if stanza.tags[1].name == "query" then

View file

@ -29,7 +29,7 @@ local rm_remove_from_roster = require "core.rostermanager".remove_from_roster;
local rm_add_to_roster = require "core.rostermanager".add_to_roster;
local rm_roster_push = require "core.rostermanager".roster_push;
require "core.discomanager".set("roster", "jabber:iq:roster");
module:add_feature("jabber:iq:roster");
module:add_iq_handler("c2s", "jabber:iq:roster",
function (session, stanza)

View file

@ -25,7 +25,7 @@ local legacy = require "util.datetime".legacy;
-- XEP-0202: Entity Time
require "core.discomanager".set("time", "urn:xmpp:time");
module:add_feature("urn:xmpp:time");
module:add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:time",
function(session, stanza)
@ -38,7 +38,7 @@ module:add_iq_handler({"c2s", "s2sin"}, "urn:xmpp:time",
-- XEP-0090: Entity Time (deprecated)
require "core.discomanager".set("time", "jabber:iq:time");
module:add_feature("jabber:iq:time");
module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:time",
function(session, stanza)

View file

@ -26,7 +26,7 @@ local t_concat = table.concat;
local start_time = os.time();
require "core.discomanager".set("uptime", "jabber:iq:last");
module:add_feature("jabber:iq:last");
module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last",
function (origin, stanza)

View file

@ -28,7 +28,7 @@ local t_concat, t_insert = table.concat, table.insert;
require "util.jid"
local jid_split = jid.split;
require "core.discomanager".set("vcard", "vcard-temp");
module:add_feature("vcard-temp");
module:add_iq_handler({"c2s", "s2sin"}, "vcard-temp",
function (session, stanza)

View file

@ -25,7 +25,7 @@ local log = require "util.logger".init("mod_version");
local xmlns_version = "jabber:iq:version"
require "core.discomanager".set("version", xmlns_version);
module:add_feature(xmlns_version);
local function handle_version_request(session, stanza)
if stanza.attr.type == "get" then