diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-08-18 12:35:42 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-08-18 12:35:42 +0500 |
commit | ff0bd781d2b360917d1861166657d0e11446d97c (patch) | |
tree | 012924acb3d0287a0307c206fb17a66edc5c4ede /core | |
parent | d772917f2d53a40d2478e6e65fa5b20ed2ee5581 (diff) | |
download | prosody-ff0bd781d2b360917d1861166657d0e11446d97c.tar.gz prosody-ff0bd781d2b360917d1861166657d0e11446d97c.zip |
modulemanager: Added module API function to get all items for a given host based on a key
Diffstat (limited to 'core')
-rw-r--r-- | core/modulemanager.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua index ff31271b..36403b60 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -443,6 +443,19 @@ function api:remove_item(key, value) end end +function api:get_host_items(key) + local result = {}; + for mod_name, module in pairs(modulemap[self.host]) do + module = module.module; + if module.items then + for _, item in ipairs(module.items[key] or NULL) do + t_insert(result, item); + end + end + end + return result; +end + -------------------------------------------------------------------- local actions = {}; |