Software /
code /
prosody
Changeset
421:63be85693710
Modules now sending disco replies
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 26 Nov 2008 08:27:09 +0500 |
parents | 420:aa1db0a80089 |
children | 422:61c8877d703c |
files | plugins/mod_disco.lua plugins/mod_legacyauth.lua plugins/mod_private.lua plugins/mod_register.lua plugins/mod_roster.lua plugins/mod_uptime.lua plugins/mod_vcard.lua plugins/mod_version.lua |
diffstat | 8 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_disco.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_disco.lua Wed Nov 26 08:27:09 2008 +0500 @@ -1,6 +1,9 @@ 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"); + add_iq_handler({"c2s", "s2sin"}, "http://jabber.org/protocol/disco#info", function (session, stanza) session.send(discomanager_handle(stanza)); end);
--- a/plugins/mod_legacyauth.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_legacyauth.lua Wed Nov 26 08:27:09 2008 +0500 @@ -2,6 +2,8 @@ local st = require "util.stanza"; local t_concat = table.concat; +require "core.discomanager".set("legacyauth", "jabber:iq:auth"); + add_iq_handler("c2s_unauthed", "jabber:iq:auth", function (session, stanza) local username = stanza.tags[1]:child_with_name("username");
--- a/plugins/mod_private.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_private.lua Wed Nov 26 08:27:09 2008 +0500 @@ -4,6 +4,8 @@ local jid_split = require "util.jid".split; local datamanager = require "util.datamanager" +require "core.discomanager".set("private", "jabber:iq:private"); + add_iq_handler("c2s", "jabber:iq:private", function (session, stanza) local type = stanza.attr.type;
--- a/plugins/mod_register.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_register.lua Wed Nov 26 08:27:09 2008 +0500 @@ -4,6 +4,8 @@ local usermanager_create_user = require "core.usermanager".create_user; local datamanager_store = require "util.datamanager".store; +require "core.discomanager".set("register", "jabber:iq:register"); + add_iq_handler("c2s", "jabber:iq:register", function (session, stanza) if stanza.tags[1].name == "query" then local query = stanza.tags[1];
--- a/plugins/mod_roster.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_roster.lua Wed Nov 26 08:27:09 2008 +0500 @@ -9,6 +9,8 @@ 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"); + add_iq_handler("c2s", "jabber:iq:roster", function (session, stanza) if stanza.tags[1].name == "query" then
--- a/plugins/mod_uptime.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_uptime.lua Wed Nov 26 08:27:09 2008 +0500 @@ -6,6 +6,8 @@ local start_time = os.time(); +require "core.discomanager".set("uptime", "jabber:iq:last"); + add_iq_handler({"c2s", "s2sin"}, "jabber:iq:last", function (origin, stanza) if stanza.tags[1].name == "query" then @@ -20,5 +22,3 @@ end end end); - -
--- a/plugins/mod_vcard.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_vcard.lua Wed Nov 26 08:27:09 2008 +0500 @@ -8,6 +8,8 @@ require "util.jid" local jid_split = jid.split; +require "core.discomanager".set("vcard", "vcard-temp"); + add_iq_handler({"c2s", "s2sin"}, "vcard-temp", function (session, stanza) if stanza.tags[1].name == "vCard" then
--- a/plugins/mod_version.lua Wed Nov 26 08:26:24 2008 +0500 +++ b/plugins/mod_version.lua Wed Nov 26 08:27:09 2008 +0500 @@ -5,6 +5,8 @@ local xmlns_version = "jabber:iq:version" +require "core.discomanager".set("version", xmlns_version); + local function handle_version_request(session, stanza) if stanza.attr.type == "get" then session.send(st.reply(stanza):query(xmlns_version)