Diff

core/moduleapi.lua @ 4695:838ad61c6b2c

moduleapi: Add module:unhook_object_event()
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Apr 2012 05:39:27 +0100
parent 4666:fb522fbd495e
child 4707:d8fc9a1aabeb
line wrap: on
line diff
--- a/core/moduleapi.lua	Thu Apr 26 04:24:43 2012 +0100
+++ b/core/moduleapi.lua	Thu Apr 26 05:39:27 2012 +0100
@@ -73,6 +73,10 @@
 	return object.add_handler(event, handler, priority);
 end
 
+function api:unhook_object_event(event, handler)
+	return object.remove_handler(event, handler);
+end
+
 function api:hook(event, handler, priority)
 	return self:hook_object_event((hosts[self.host] or prosody).events, event, handler, priority);
 end