# HG changeset patch # User Matthew Wild # Date 1335415167 -3600 # Node ID 838ad61c6b2ce7b3147daa67f5ee45d44befc4cd # Parent f9a091b6dfd50d6088575dfa96cd39ef98883d56 moduleapi: Add module:unhook_object_event() diff -r f9a091b6dfd5 -r 838ad61c6b2c core/moduleapi.lua --- 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