aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-26 03:29:06 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-26 03:29:06 +0000
commit9cfa2fe191348aa9e5800cde5b05eab8f6868100 (patch)
tree280afe4c6629378b30171c44ff869e8f634f39e2 /core
parent78cffc8a02012c14644a08fb07dd05c760dcba06 (diff)
parentf68d335729ced9399427793ef17de847f21f8d4d (diff)
downloadprosody-9cfa2fe191348aa9e5800cde5b05eab8f6868100.tar.gz
prosody-9cfa2fe191348aa9e5800cde5b05eab8f6868100.zip
Merge from waqas
Diffstat (limited to 'core')
-rw-r--r--core/discomanager.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/discomanager.lua b/core/discomanager.lua
index 5f7b3c78..ce0010d8 100644
--- a/core/discomanager.lua
+++ b/core/discomanager.lua
@@ -5,6 +5,7 @@ local jid_split = require "util.jid".split;
local jid_bare = require "util.jid".bare;
local usermanager_user_exists = require "core.usermanager".user_exists;
local rostermanager_is_contact_subscribed = require "core.rostermanager".is_contact_subscribed;
+local print = print;
do
helper:addDiscoInfoHandler("*host", function(reply, to, from, node)
@@ -36,4 +37,16 @@ function addDiscoInfoHandler(jid, func)
return helper:addDiscoInfoHandler(jid, func);
end
+function set(plugin, var, origin)
+ -- TODO handle origin and host based on plugin.
+ local handler = function(reply, to, from, node) -- service discovery
+ if #node == 0 then
+ reply:tag("feature", {var = var}):up();
+ return true;
+ end
+ end
+ addDiscoInfoHandler("*node", handler);
+ addDiscoInfoHandler("*host", handler);
+end
+
return _M;