# HG changeset patch # User Matthew Wild # Date 1472640641 -3600 # Node ID 90a4790c2329f683aab66a123789d0fa7daf8d36 # Parent 44fe2aaf817e7c8ba9256fef5fe57e88237e71c8 storagemanager: Fire event when opening a store, and allow the returned store/err to be overridden diff -r 44fe2aaf817e -r 90a4790c2329 core/storagemanager.lua --- a/core/storagemanager.lua Wed Aug 31 11:45:06 2016 +0100 +++ b/core/storagemanager.lua Wed Aug 31 11:50:41 2016 +0100 @@ -161,6 +161,11 @@ 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