view util/bitcompat.lua @ 13941:f4e16e6265e6 13.0

mod_muc: Remove avatar hash caching Computing the hash of the room might be a bit expensive, but this cache was preventing any change from reaching clients, so let’s disable it. Fixes #1961.
author Link Mauve <linkmauve@linkmauve.fr>
date Mon, 08 Sep 2025 12:19:26 +0200
parents de902cc0d46c
children
line wrap: on
line source

-- Compatibility layer for bitwise operations

-- First try the bit32 lib
-- Lua 5.3 has it with compat enabled
-- Lua 5.2 has it by default
if rawget(_G, "bit32") then
	return _G.bit32;
end

do
	-- Lua 5.3 and 5.4 would be able to use native infix operators
	local ok, bitop = pcall(require, "prosody.util.bit53")
	if ok then
		return bitop;
	end
end

error "No bit module found. See https://prosody.im/doc/depends#bitop";