# HG changeset patch # User Vadim Misbakh-Soloviov # Date 1392807819 -25200 # Node ID 27b2a357c73c3ffde87b917814bdb14c4eec5db2 # Parent 2df312eb816d1ab1b018ab02cdda02fcd7cb351b mod_mam_muc: porting archive checks from mod_mam (to avoid tracebacks about calling null functions) diff -r 2df312eb816d -r 27b2a357c73c mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Wed Feb 19 17:59:17 2014 +0700 +++ b/mod_mam_muc/mod_mam_muc.lua Wed Feb 19 18:03:39 2014 +0700 @@ -30,7 +30,16 @@ local log_by_default = module:get_option_boolean("muc_log_by_default", true); local advertise_archive = module:get_option_boolean("muc_log_advertise", true); -local archive = module:open_store("archive2", "archive"); +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 + local rooms = hosts[module.host].modules.muc.rooms; if not log_all_rooms then