aboutsummaryrefslogtreecommitdiffstats
path: root/core/storagemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-07-28 20:59:03 +0100
committerMatthew Wild <mwild1@gmail.com>2012-07-28 20:59:03 +0100
commit8aafe03289bdc2e8697bf72d226c4325ffc8d51f (patch)
tree57f657bdb5f9107ab5d46cd8ea6e0f18e7a20b11 /core/storagemanager.lua
parent655defbb532f079c1476511db9c47b141a1d9792 (diff)
parent5e57a36957ea2d717865eefa2155c5dc854f8b4d (diff)
downloadprosody-8aafe03289bdc2e8697bf72d226c4325ffc8d51f.tar.gz
prosody-8aafe03289bdc2e8697bf72d226c4325ffc8d51f.zip
Merge with Zash
Diffstat (limited to 'core/storagemanager.lua')
-rw-r--r--core/storagemanager.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index 71e79271..3379cc0c 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -58,7 +58,7 @@ function load_driver(host, driver_name)
return stores_available:get(host, driver_name);
end
-function open(host, store, typ)
+function get_driver(host, store)
local storage = config.get(host, "core", "storage");
local driver_name;
local option_type = type(storage);
@@ -77,7 +77,11 @@ function open(host, store, typ)
driver_name = "null";
driver = null_storage_driver;
end
+ return driver, driver_name;
+ end
+function open(host, store, typ)
+ local driver, driver_name = get_driver(host, store);
local ret, err = driver:open(store, typ);
if not ret then
if err == "unsupported-store" then
@@ -96,5 +100,11 @@ end
function datamanager.store(username, host, datastore, data)
return open(host, datastore):set(username, data);
end
+function datamanager.list_stores(username, host)
+ return get_driver(host):list_stores(username, host);
+end
+function datamanager.purge(username, host)
+ return get_driver(host):purge(username, host);
+end
return _M;