Software / code / prosody
Comparison
core/modulemanager.lua @ 1698:af89f646200f
modulemanager: Added module API function to get all items for a given host based on a key
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Tue, 18 Aug 2009 12:35:42 +0500 |
| parent | 1697:f1783e621a36 |
| child | 1706:0e6ba1678d8e |
comparison
equal
deleted
inserted
replaced
| 1697:f1783e621a36 | 1698:af89f646200f |
|---|---|
| 441 return value; | 441 return value; |
| 442 end | 442 end |
| 443 end | 443 end |
| 444 end | 444 end |
| 445 | 445 |
| 446 function api:get_host_items(key) | |
| 447 local result = {}; | |
| 448 for mod_name, module in pairs(modulemap[self.host]) do | |
| 449 module = module.module; | |
| 450 if module.items then | |
| 451 for _, item in ipairs(module.items[key] or NULL) do | |
| 452 t_insert(result, item); | |
| 453 end | |
| 454 end | |
| 455 end | |
| 456 return result; | |
| 457 end | |
| 458 | |
| 446 -------------------------------------------------------------------- | 459 -------------------------------------------------------------------- |
| 447 | 460 |
| 448 local actions = {}; | 461 local actions = {}; |
| 449 | 462 |
| 450 function actions.load(params) | 463 function actions.load(params) |