Changeset

5825:ac5e05ffc921

moduleapi: Add module:unhook()
author Matthew Wild <mwild1@gmail.com>
date Mon, 16 Sep 2013 18:41:09 +0100
parents 5824:6f4c8af128e2
children 5827:ae16bf17785d
files core/moduleapi.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/moduleapi.lua	Fri Sep 06 10:53:04 2013 +0200
+++ b/core/moduleapi.lua	Mon Sep 16 18:41:09 2013 +0100
@@ -113,6 +113,10 @@
 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