diff options
author | Waqas Hussain <waqas20@gmail.com> | 2008-11-26 07:44:38 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2008-11-26 07:44:38 +0500 |
commit | e96a7a068983fc064815e509cbb6ec003e3961a2 (patch) | |
tree | 5219d2565cba6f67370740839870e88332e23ba6 | |
parent | 15d8fc0d62296146e8901d345fa74cecf03e2d77 (diff) | |
download | prosody-e96a7a068983fc064815e509cbb6ec003e3961a2.tar.gz prosody-e96a7a068983fc064815e509cbb6ec003e3961a2.zip |
Added helper method to discomanager
-rw-r--r-- | core/discomanager.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/discomanager.lua b/core/discomanager.lua index 5f7b3c78..5686f47f 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, origin, var)
+ -- 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});
+ return true;
+ end
+ end
+ addDiscoInfoHandler("*node", handler);
+ addDiscoInfoHandler("*host", handler);
+end
+
return _M;
|