Software /
code /
prosody
Comparison
core/modulemanager.lua @ 1248:9a482f76a20a
modulemanager: Made some code more concise
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 31 May 2009 00:54:33 +0500 |
parent | 1247:4721e4124692 |
child | 1250:ef053ab86f5e |
comparison
equal
deleted
inserted
replaced
1247:4721e4124692 | 1248:9a482f76a20a |
---|---|
354 function api:fire_event(...) | 354 function api:fire_event(...) |
355 return eventmanager.fire_event(...); | 355 return eventmanager.fire_event(...); |
356 end | 356 end |
357 | 357 |
358 function api:hook(event, handler) | 358 function api:hook(event, handler) |
359 if self.host ~= '*' then | 359 (hosts[self.host] or prosody).events.add_handler(event, handler); |
360 hosts[self.host].events.add_handler(event, handler); | |
361 else | |
362 prosody.events.add_handler(event, handler); | |
363 end | |
364 end | 360 end |
365 | 361 |
366 -------------------------------------------------------------------- | 362 -------------------------------------------------------------------- |
367 | 363 |
368 local actions = {}; | 364 local actions = {}; |