aboutsummaryrefslogtreecommitdiffstats
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
commit88613e4e188d1ea21f44d7db686a06287ffee6a6 (patch)
tree8a6566f103557bfe7152d2c8de256f5fabd8b4db
parent314c9eec90110aa104a066f22d48e9420705f769 (diff)
downloadprosody-88613e4e188d1ea21f44d7db686a06287ffee6a6.tar.gz
prosody-88613e4e188d1ea21f44d7db686a06287ffee6a6.zip
moduleapi: Add module:unhook()
-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