From 786f912ac4d323faac073c0a245a7aa339b15e0a Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 31 Aug 2016 11:50:41 +0100 Subject: storagemanager: Fire event when opening a store, and allow the returned store/err to be overridden --- core/storagemanager.lua | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3