aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/modulemanager.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 57a44c29..901659f7 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -354,6 +354,14 @@ function api:fire_event(...)
return eventmanager.fire_event(...);
end
+function api:hook(event, handler)
+ if self.host ~= '*' then
+ hosts[self.host].events.add_handler(event, handler);
+ else
+ self:log("error", "Global module attempting to hook a host-specific event: %s", event);
+ end
+end
+
--------------------------------------------------------------------
local actions = {};