#605 module:context(host):hook() doesn't work if host hasn't been activated yet
Reporter
Daurnimator
Owner
Nobody
Created
Updated
Stars
★ (1)
Tags
Status-Accepted
Priority-Medium
Type-Defect
Daurnimator
on
`module:context(host):hook()` doesn't work if host hasn't been activated yet.
```lua
function api:hook(event, handler, priority)
return self:hook_object_event((hosts[self.host] or prosody).events, event, handler, priority);
end
```
If the host hasn't been activated yet (e.g. during startup) it ends up attaching the event to the global `prosody` object instead.
`module:context(host):hook()` doesn't work if host hasn't been activated yet. ```lua function api:hook(event, handler, priority) return self:hook_object_event((hosts[self.host] or prosody).events, event, handler, priority); end ``` If the host hasn't been activated yet (e.g. during startup) it ends up attaching the event to the global `prosody` object instead.