This commit is contained in:
John Livingston 2024-02-12 17:27:03 +01:00
parent 5aaeb18e3e
commit 40bf9c613f
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC

View File

@ -10,6 +10,7 @@ local avatars_files = assert(module:get_option_array("peertubelivechat_random_vc
local avatars = {};
local function load_avatar(filename)
local file = assert(io.open(path.join(avatars_dir, filename), "r"));
-- FIXME: check filetype, to only allow jpg or png. (for the day we would allow users to add custom avatars sets)
local filetype = filename.sub(filename, -3); -- jpg or png
local result = {
type = 'image/' .. filetype,