# HG changeset patch # User Kim Alvefur # Date 1453222745 -3600 # Node ID 6f4dcc723a606ac6c23516413f80bafa322dba28 # Parent 98b4794b72e4ca96f132062afa146d8da36d9026 mod_mam: Use the fallback driver if either the null driver or a driver that does not implement the archive api is returned diff -r 98b4794b72e4 -r 6f4dcc723a60 mod_mam/mod_mam.lua --- a/mod_mam/mod_mam.lua Tue Jan 19 17:47:47 2016 +0100 +++ b/mod_mam/mod_mam.lua Tue Jan 19 17:59:05 2016 +0100 @@ -38,14 +38,16 @@ local archive_store = "archive2"; local archive = assert(module:open_store(archive_store, "archive")); -if archive.name == "null" then +if archive.name == "null" or not archive.find then + if not archive.find then + module:log("debug", "Attempt to open archive storage returned a valid driver but it does not seem to implement the storage API"); + module:log("debug", "mod_%s does not support archiving", archive._provided_by or archive.name and "storage_"..archive.name.."(?)" or ""); + else + module:log("debug", "Attempt to open archive storage returned null driver"); + end + module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information"); module:log("info", "Using in-memory fallback archive driver"); archive = module:require "fallback_archive"; -elseif not archive.find then - module:log("debug", "Attempt to open archive storage returned a valid driver but it does not seem to implement the storage API"); - module:log("error", "mod_%s does not support archiving", archive._provided_by or archive.name and "storage_"..archive.name.."(?)" or ""); - module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information"); - return; end local cleanup;