aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-08-31 11:50:41 +0100
committerMatthew Wild <mwild1@gmail.com>2016-08-31 11:50:41 +0100
commit21f08b2dfe144c8988dfa1cfafe10d15687e3542 (patch)
treed40df0b01f758ee870742226d7d79cff57b4990f /core
parente73a68034cbc4bd3425d6003c084ca6d4dd3a8c5 (diff)
downloadprosody-21f08b2dfe144c8988dfa1cfafe10d15687e3542.tar.gz
prosody-21f08b2dfe144c8988dfa1cfafe10d15687e3542.zip
storagemanager: Fire event when opening a store, and allow the returned store/err to be overridden
Diffstat (limited to 'core')
-rw-r--r--core/storagemanager.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index 64ae13e3..255a9a49 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -161,6 +161,11 @@ function open(host, store, typ)
end
end
end
+ if ret then
+ local event_data = { host = host, store_name = store, store_type = typ, store = ret };
+ prosody.hosts[host].fire_event("store-opened", event_data);
+ ret, err = event_data.store, event_data.store_err;
+ end
return ret, err;
end