Comparison

mod_mam/mod_mam.lua @ 2023:98b4794b72e4

mod_mam: Include an in-memory fallback driver
author Kim Alvefur <zash@zash.se>
date Tue, 19 Jan 2016 17:47:47 +0100
parent 2022:77b9c7e5fd63
child 2024:6f4dcc723a60
comparison
equal deleted inserted replaced
2022:77b9c7e5fd63 2023:98b4794b72e4
37 37
38 local archive_store = "archive2"; 38 local archive_store = "archive2";
39 local archive = assert(module:open_store(archive_store, "archive")); 39 local archive = assert(module:open_store(archive_store, "archive"));
40 40
41 if archive.name == "null" then 41 if archive.name == "null" then
42 module:log("debug", "Attempt to open archive storage returned null driver"); 42 module:log("info", "Using in-memory fallback archive driver");
43 module:log("error", "Unable to open archive storage, no archive capable storage driver enabled?"); 43 archive = module:require "fallback_archive";
44 module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information");
45 return;
46 elseif not archive.find then 44 elseif not archive.find then
47 module:log("debug", "Attempt to open archive storage returned a valid driver but it does not seem to implement the storage API"); 45 module:log("debug", "Attempt to open archive storage returned a valid driver but it does not seem to implement the storage API");
48 module:log("error", "mod_%s does not support archiving", archive._provided_by or archive.name and "storage_"..archive.name.."(?)" or "<unknown>"); 46 module:log("error", "mod_%s does not support archiving", archive._provided_by or archive.name and "storage_"..archive.name.."(?)" or "<unknown>");
49 module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information"); 47 module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information");
50 return; 48 return;