Diff

mod_onions/mod_onions.lua @ 4954:e8a487c42b36

merge upstream
author Goffi <goffi@goffi.org>
date Sat, 28 May 2022 16:43:04 +0200
parent 4945:fa415cd9eeca
line wrap: on
line diff
--- a/mod_onions/mod_onions.lua	Sat May 28 16:42:13 2022 +0200
+++ b/mod_onions/mod_onions.lua	Sat May 28 16:43:04 2022 +0200
@@ -10,10 +10,7 @@
 
 local softreq = require "util.dependencies".softreq;
 
-local bit;
-pcall(function() bit = require"bit"; end);
-bit = bit or softreq"bit32"
-if not bit then module:log("error", "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); end
+local bit = assert(softreq "bit" or softreq "bit32" or softreq "util.bitcompat", "No bit module found. See https://prosody.im/doc/depends#bitop");
 
 local band = bit.band;
 local rshift = bit.rshift;