fix avatars

This commit is contained in:
Lera Elvoé 2025-05-25 05:21:35 +03:00
parent ca0256268b
commit 82fb724770
Signed by: yagich
SSH Key Fingerprint: SHA256:6xjGb6uA7lAVcULa7byPEN//rQ0wPoG+UzYVMfZnbvc
2 changed files with 2 additions and 2 deletions

View File

@ -179,7 +179,7 @@ app:post("user_set_avatar", "/:username/set_avatar", function(self)
local time = os.time()
local filename = "u" .. target_user.id .. "d" .. time .. ".webp"
local proxied_filename = "/avatars/" .. filename
local save_path = "static" .. proxied_filename
local save_path = "data/static" .. proxied_filename
local res = util.validate_and_create_image(file.content, save_path)
if not res then
util.inject_warn_infobox(self, "Something went wrong. Try again later.")

View File

@ -203,7 +203,7 @@ function util.destroy_avatar(avatar_id)
return
end
local file_path = "static" .. avatar.file_path
local file_path = "data/static" .. avatar.file_path
local f = io.open(file_path, "r")
if not f then
print("can't open avatar file")