Changeset

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
parents 540:ec03f6968fa8
children 542:c9dbfcf21846
files plugins/mod_disco.lua plugins/mod_legacyauth.lua plugins/mod_ping.lua plugins/mod_private.lua plugins/mod_register.lua plugins/mod_roster.lua plugins/mod_time.lua plugins/mod_uptime.lua plugins/mod_vcard.lua plugins/mod_version.lua
diffstat 10 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_disco.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_disco.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -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));
--- a/plugins/mod_legacyauth.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_legacyauth.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -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)
--- a/plugins/mod_ping.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_ping.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -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)
--- a/plugins/mod_private.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_private.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -24,7 +24,7 @@
 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)
--- a/plugins/mod_register.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_register.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -24,7 +24,7 @@
 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
--- a/plugins/mod_roster.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_roster.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -29,7 +29,7 @@
 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)
--- a/plugins/mod_time.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_time.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -25,7 +25,7 @@
 
 -- 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 @@
 
 -- 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)
--- a/plugins/mod_uptime.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_uptime.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -26,7 +26,7 @@
 
 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)
--- a/plugins/mod_vcard.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_vcard.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -28,7 +28,7 @@
 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)
--- a/plugins/mod_version.lua	Thu Dec 04 20:07:22 2008 +0500
+++ b/plugins/mod_version.lua	Thu Dec 04 20:16:30 2008 +0500
@@ -25,7 +25,7 @@
 
 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