Diff

core/moduleapi.lua @ 7141:362545c3f8bb

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Fri, 05 Feb 2016 00:04:11 +0000
parent 7116:ecba5fee4867
parent 7127:27557dd7b460
child 7142:67226eaef97c
line wrap: on
line diff
--- a/core/moduleapi.lua	Thu Feb 04 14:57:45 2016 +0000
+++ b/core/moduleapi.lua	Fri Feb 05 00:04:11 2016 +0000
@@ -303,6 +303,20 @@
 	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