Comparison

core/storagemanager.lua @ 7644:90a4790c2329

storagemanager: Fire event when opening a store, and allow the returned store/err to be overridden
author Matthew Wild <mwild1@gmail.com>
date Wed, 31 Aug 2016 11:50:41 +0100
parent 7643:44fe2aaf817e
child 7645:d7b1bc069c12
comparison
equal deleted inserted replaced
7643:44fe2aaf817e 7644:90a4790c2329
159 driver_name, store, typ or "<nil>"); 159 driver_name, store, typ or "<nil>");
160 ret, err = null_storage_driver, nil; 160 ret, err = null_storage_driver, nil;
161 end 161 end
162 end 162 end
163 end 163 end
164 if ret then
165 local event_data = { host = host, store_name = store, store_type = typ, store = ret };
166 prosody.hosts[host].fire_event("store-opened", event_data);
167 ret, err = event_data.store, event_data.store_err;
168 end
164 return ret, err; 169 return ret, err;
165 end 170 end
166 171
167 local function purge(user, host) 172 local function purge(user, host)
168 local storage = get_storage_config(host); 173 local storage = get_storage_config(host);