# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1379353269 -3600
# Node ID ac5e05ffc92148bdbdaddab337867d24f08e2033
# Parent  6f4c8af128e2508b4dc2c5bdb17497d792dd3f81
moduleapi: Add module:unhook()

diff -r 6f4c8af128e2 -r ac5e05ffc921 core/moduleapi.lua
--- 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