Changeset

1185:30b681898c2d

mod_mam: Log error message if unable to open archive storage
author Kim Alvefur <zash@zash.se>
date Thu, 05 Sep 2013 15:22:31 +0200
parents 1184:0d3d15586d7e
children 1186:a172e7389cf6
files mod_mam/mod_mam.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_mam/mod_mam.lua	Thu Sep 05 01:02:01 2013 +0200
+++ b/mod_mam/mod_mam.lua	Thu Sep 05 15:22:31 2013 +0200
@@ -34,6 +34,13 @@
 
 local archive_store = "archive2";
 local archive = module:open_store(archive_store, "archive");
+if not archive then
+	module:log("error", "Could not open archive storage");
+	return
+elseif not archive.find then
+	module:log("error", "mod_%s does not support archiving, switch to mod_storage_sql2", archive._provided_by);
+	return
+end
 
 -- Handle prefs.
 module:hook("iq/self/"..xmlns_mam..":prefs", function(event)