aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-12-04 20:16:30 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-12-04 20:16:30 +0500
commit2d2414f199a416409e84a3ef9c38a84ea0ba825b (patch)
treedc905cc58daf6473950071c0886043fca13df861 /plugins
parentfcf33a735bd454e7d755c36be93e011ff5754283 (diff)
downloadprosody-2d2414f199a416409e84a3ef9c38a84ea0ba825b.tar.gz
prosody-2d2414f199a416409e84a3ef9c38a84ea0ba825b.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_disco.lua4
-rw-r--r--plugins/mod_legacyauth.lua2
-rw-r--r--plugins/mod_ping.lua2
-rw-r--r--plugins/mod_private.lua2
-rw-r--r--plugins/mod_register.lua2
-rw-r--r--plugins/mod_roster.lua2
-rw-r--r--plugins/mod_time.lua4
-rw-r--r--plugins/mod_uptime.lua2
-rw-r--r--plugins/mod_vcard.lua2
-rw-r--r--plugins/mod_version.lua2
10 files changed, 12 insertions, 12 deletions
diff --git a/plugins/mod_disco.lua b/plugins/mod_disco.lua
index 36e18f75..455f92f1 100644
--- a/plugins/mod_disco.lua
+++ b/plugins/mod_disco.lua
@@ -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));
diff --git a/plugins/mod_legacyauth.lua b/plugins/mod_legacyauth.lua
index 1f1789a9..ca2d9f78 100644
--- a/plugins/mod_legacyauth.lua
+++ b/plugins/mod_legacyauth.lua
@@ -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)
diff --git a/plugins/mod_ping.lua b/plugins/mod_ping.lua
index 78bdb222..922c9390 100644
--- a/plugins/mod_ping.lua
+++ b/plugins/mod_ping.lua
@@ -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)
diff --git a/plugins/mod_private.lua b/plugins/mod_private.lua
index f1eee55e..8bcb6da6 100644
--- a/plugins/mod_private.lua
+++ b/plugins/mod_private.lua
@@ -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)
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua
index f9e85fff..29474461 100644
--- a/plugins/mod_register.lua
+++ b/plugins/mod_register.lua
@@ -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
diff --git a/plugins/mod_roster.lua b/plugins/mod_roster.lua
index 60d481ce..7e114b17 100644
--- a/plugins/mod_roster.lua
+++ b/plugins/mod_roster.lua
@@ -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)
diff --git a/plugins/mod_time.lua b/plugins/mod_time.lua
index 9a61d90c..3d73623c 100644
--- a/plugins/mod_time.lua
+++ b/plugins/mod_time.lua
@@ -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)
diff --git a/plugins/mod_uptime.lua b/plugins/mod_uptime.lua
index 2f04fc6f..51457551 100644
--- a/plugins/mod_uptime.lua
+++ b/plugins/mod_uptime.lua
@@ -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)
diff --git a/plugins/mod_vcard.lua b/plugins/mod_vcard.lua
index 6b8ee23a..4f78867b 100644
--- a/plugins/mod_vcard.lua
+++ b/plugins/mod_vcard.lua
@@ -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)
diff --git a/plugins/mod_version.lua b/plugins/mod_version.lua
index e16d8aa7..0b7ebfaa 100644
--- a/plugins/mod_version.lua
+++ b/plugins/mod_version.lua
@@ -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