From 1878c499486efa5ae29fb3b4fb9b5bcfbc047a57 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 7 Jun 2009 18:04:56 +0500 Subject: modulemanager: Allow setting a priority while adding an event handler via the module:hook API --- core/modulemanager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 18b511e6..748c7dce 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -368,9 +368,9 @@ function api:fire_event(...) return (hosts[self.host] or prosody).events.fire_event(...); end -function api:hook(event, handler) +function api:hook(event, handler, priority) hooks:set(self.host, self.name, event, handler, true); - (hosts[self.host] or prosody).events.add_handler(event, handler); + (hosts[self.host] or prosody).events.add_handler(event, handler, priority); end -------------------------------------------------------------------- -- cgit v1.2.3