diff options
author | Matthew Wild <mwild1@gmail.com> | 2016-02-05 00:04:11 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2016-02-05 00:04:11 +0000 |
commit | 9f2f783a50b33805c83b2e9a8f3e5784bec286ce (patch) | |
tree | a3336425edbdcdc8ad540dc565daac709882207b /core/moduleapi.lua | |
parent | 60f27c0c88d9fcf80405d7653f9ffdf7a32dbd32 (diff) | |
parent | 7a87ef0b67fc74c7b55ed19dccf7bd66df4079ce (diff) | |
download | prosody-9f2f783a50b33805c83b2e9a8f3e5784bec286ce.tar.gz prosody-9f2f783a50b33805c83b2e9a8f3e5784bec286ce.zip |
Merge 0.10->trunk
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r-- | core/moduleapi.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index bdf9959f..ff68a15c 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -303,6 +303,20 @@ function api:get_option_inherited_set(name, ...) return value; end +function api:get_option_path(name, default, parent) + if parent == nil then + parent = parent or self:get_directory(); + elseif prosody.paths[parent] then + parent = prosody.paths[parent]; + end + local value = self:get_option_string(name, default); + if value == nil then + return nil; + end + return resolve_relative_path(parent, value); +end + + function api:context(host) return setmetatable({host=host or "*"}, {__index=self,__newindex=self}); end |