# HG changeset patch # User Matthew Wild # Date 1533292411 -3600 # Node ID 9505282ad24faae75279ed9ad881e5e02dd2d160 # Parent 5b02241a254e21e053ff8254bf0ce33f379fdaf3 mod_omemo_all_access: Add compatibility with mod_pep_simple diff -r 5b02241a254e -r 9505282ad24f mod_omemo_all_access/mod_omemo_all_access.lua --- a/mod_omemo_all_access/mod_omemo_all_access.lua Fri Aug 03 11:24:36 2018 +0100 +++ b/mod_omemo_all_access/mod_omemo_all_access.lua Fri Aug 03 11:33:31 2018 +0100 @@ -9,11 +9,25 @@ local white_listed_namespace = "eu.siacs.conversations.axolotl." local disco_feature_namespace = white_listed_namespace .. "whitelisted" -local mod_pep = module:depends"pep"; +local mm = require "core.modulemanager"; + + +-- COMPAT w/trunk +local pep_module_name = "pep"; +if mm.get_modules_for_host then + if mm.get_modules_for_host(module.host):contains("pep_simple") then + pep_module_name = "pep_simple"; + end +end + +local mod_pep = module:depends(pep_module_name); local pep_data = mod_pep.module.save().data; if not pep_data then module:log("error", "This module is not compatible with your version of mod_pep"); + if mm.get_modules_for_host then + module:log("error", "Please use mod_pep_simple instead of mod_pep to continue using this module"); + end return false; end