Changeset

1326:4f1994f7bd54

modulemanager: Allow setting a priority while adding an event handler via the module:hook API
author Waqas Hussain <waqas20@gmail.com>
date Sun, 07 Jun 2009 18:04:56 +0500
parents 1325:b58645973d7d
children 1327:20285e9d71ee
files core/modulemanager.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core/modulemanager.lua	Sun Jun 07 18:04:08 2009 +0500
+++ b/core/modulemanager.lua	Sun Jun 07 18:04:56 2009 +0500
@@ -368,9 +368,9 @@
 	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
 
 --------------------------------------------------------------------