Comparison

core/moduleapi.lua @ 4708:0e324923ff95

moduleapi: Fix parameters to unhook_object_event()
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Apr 2012 14:51:55 +0100
parent 4707:d8fc9a1aabeb
child 4718:a9f6088a83e3
comparison
equal deleted inserted replaced
4707:d8fc9a1aabeb 4708:0e324923ff95
71 function api:hook_object_event(object, event, handler, priority) 71 function api:hook_object_event(object, event, handler, priority)
72 self.event_handlers[handler] = { name = event, priority = priority, object = object }; 72 self.event_handlers[handler] = { name = event, priority = priority, object = object };
73 return object.add_handler(event, handler, priority); 73 return object.add_handler(event, handler, priority);
74 end 74 end
75 75
76 function api:unhook_object_event(event, handler) 76 function api:unhook_object_event(object, event, handler)
77 return object.remove_handler(event, handler); 77 return object.remove_handler(event, handler);
78 end 78 end
79 79
80 function api:hook(event, handler, priority) 80 function api:hook(event, handler, priority)
81 return self:hook_object_event((hosts[self.host] or prosody).events, event, handler, priority); 81 return self:hook_object_event((hosts[self.host] or prosody).events, event, handler, priority);