Software / code / prosody-modules
Comparison
mod_mam_muc/mod_mam_muc.lua @ 2626:17883c405df3
mod_mam_muc: Shorten some lines [luacheck]
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 21 Mar 2017 04:18:23 +0100 |
| parent | 2507:b8a66805459e |
| child | 2627:3f166242b460 |
comparison
equal
deleted
inserted
replaced
| 2625:8c6562f16496 | 2626:17883c405df3 |
|---|---|
| 1 -- XEP-0313: Message Archive Management for Prosody MUC | 1 -- XEP-0313: Message Archive Management for Prosody MUC |
| 2 -- Copyright (C) 2011-2014 Kim Alvefur | 2 -- Copyright (C) 2011-2017 Kim Alvefur |
| 3 -- | 3 -- |
| 4 -- This file is MIT/X11 licensed. | 4 -- This file is MIT/X11 licensed. |
| 5 | 5 |
| 6 if module:get_host_type() ~= "component" then | 6 if module:get_host_type() ~= "component" then |
| 7 module:log("error", "mod_%s should be loaded only on a MUC component, not normal hosts", module.name); | 7 module:log("error", "mod_%s should be loaded only on a MUC component, not normal hosts", module.name); |
| 47 local archive_store = "muc_log"; | 47 local archive_store = "muc_log"; |
| 48 local archive = module:open_store(archive_store, "archive"); | 48 local archive = module:open_store(archive_store, "archive"); |
| 49 | 49 |
| 50 if archive.name == "null" or not archive.find then | 50 if archive.name == "null" or not archive.find then |
| 51 if not archive.find then | 51 if not archive.find then |
| 52 module:log("error", "Attempt to open archive storage returned a valid driver but it does not seem to implement the storage API"); | 52 module:log("error", "Attempt to open archive storage returned a driver without archive API support"); |
| 53 module:log("error", "mod_%s does not support archiving", archive._provided_by or archive.name and "storage_"..archive.name.."(?)" or "<unknown>"); | 53 module:log("error", "mod_%s does not support archiving", |
| 54 archive._provided_by or archive.name and "storage_"..archive.name.."(?)" or "<unknown>"); | |
| 54 else | 55 else |
| 55 module:log("error", "Attempt to open archive storage returned null driver"); | 56 module:log("error", "Attempt to open archive storage returned null driver"); |
| 56 end | 57 end |
| 57 module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information"); | 58 module:log("info", "See https://prosody.im/doc/storage and https://prosody.im/doc/archiving for more information"); |
| 58 return false; | 59 return false; |