aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-09-16 18:41:09 +0100
committerMatthew Wild <mwild1@gmail.com>2013-09-16 18:41:09 +0100
commit11c4b857b8d5a6ac62dbf982d3cb98f4e173c5a5 (patch)
tree8a6566f103557bfe7152d2c8de256f5fabd8b4db /core/moduleapi.lua
parent3606c59339ea6f515165e09a3a5f85e3665595e6 (diff)
downloadprosody-11c4b857b8d5a6ac62dbf982d3cb98f4e173c5a5.tar.gz
prosody-11c4b857b8d5a6ac62dbf982d3cb98f4e173c5a5.zip
moduleapi: Add module:unhook()
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 6e857531..65e00d41 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -113,6 +113,10 @@ function api:hook_tag(xmlns, name, handler, priority)
end
api.hook_stanza = api.hook_tag; -- COMPAT w/pre-0.9
+function api:unhook(event, handler)
+ return self:unhook_object_event((hosts[self.host] or prosody).events, event, handler);
+end
+
function api:require(lib)
local f, n = pluginloader.load_code(self.name, lib..".lib.lua", self.environment);
if not f then