From 88613e4e188d1ea21f44d7db686a06287ffee6a6 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 16 Sep 2013 18:41:09 +0100 Subject: moduleapi: Add module:unhook() --- core/moduleapi.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') 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 -- cgit v1.2.3