aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/modulemanager.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index d5360037..532a0f86 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -22,7 +22,8 @@
local plugin_dir = CFG_PLUGINDIR or "./plugins/";
local logger = require "util.logger";
-local log = logger.init("modulemanager")
+local log = logger.init("modulemanager");
+local addDiscoInfoHandler = require "core.discomanager".addDiscoInfoHandler;
local loadfile, pcall = loadfile, pcall;
local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv;
@@ -172,6 +173,15 @@ function api:add_iq_handler(origin_type, xmlns, handler)
_add_iq_handler(self, origin_type, xmlns, handler);
end
+function api:add_feature(xmlns)
+ addDiscoInfoHandler(self.host, function(reply, to, from, node)
+ if #node == 0 then
+ reply:tag("feature", {var = xmlns}):up();
+ return true;
+ end
+ end);
+end
+
do
local event_handlers = {};