aboutsummaryrefslogtreecommitdiffstats
path: root/core/storagemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-08-31 16:25:21 +0100
committerMatthew Wild <mwild1@gmail.com>2016-08-31 16:25:21 +0100
commit37913e5ce81c5e0b404aa2389102e0a30b00c111 (patch)
tree4c56350b49c07b9ab63a705fc167339ef54dca96 /core/storagemanager.lua
parentf25bb95b8680adffa070c07fa762bde6af383957 (diff)
parente2dbea53b4aa078633e6270da25a633741d4ae23 (diff)
downloadprosody-37913e5ce81c5e0b404aa2389102e0a30b00c111.tar.gz
prosody-37913e5ce81c5e0b404aa2389102e0a30b00c111.zip
Merge 0.10->trunk
Diffstat (limited to 'core/storagemanager.lua')
-rw-r--r--core/storagemanager.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index cadae0ed..f0450dfb 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -153,14 +153,19 @@ function open(host, store, typ)
if err == "unsupported-store" then
if typ == "map" then -- Use shim on top of keyval store
log("debug", "map storage driver unavailable, using shim on top of keyval store.");
- return create_map_shim(host, store);
+ ret, err = create_map_shim(host, store);
+ else
+ log("debug", "Storage driver %s does not support store %s (%s), falling back to null driver",
+ driver_name, store, typ or "<nil>");
+ ret, err = null_storage_driver, nil;
end
- log("debug", "Storage driver %s does not support store %s (%s), falling back to null driver",
- driver_name, store, typ or "<nil>");
- ret = null_storage_driver;
- err = nil;
end
end
+ if ret then
+ local event_data = { host = host, store_name = store, store_type = typ, store = ret };
+ prosody.hosts[host].events.fire_event("store-opened", event_data);
+ ret, err = event_data.store, event_data.store_err;
+ end
return ret, err;
end