mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
fix: Don't remove file extension when recoding avatars
There was a bug that file extensions were removed when recoding an avatar. The problem was that `recode_avatar` used `name` to check for the extension, but some functions passed an empty string. There even were two tests from before the decision to keep the extensions that tested for the faulty behavior.
This commit is contained in:
@@ -2782,11 +2782,7 @@ async fn prepare_msg_blob(context: &Context, msg: &mut Message) -> Result<()> {
|
||||
|| maybe_sticker && !msg.param.exists(Param::ForceSticker))
|
||||
{
|
||||
let new_name = blob
|
||||
.recode_to_image_size(
|
||||
context,
|
||||
msg.get_filename().unwrap_or_else(|| "file".to_string()),
|
||||
&mut maybe_sticker,
|
||||
)
|
||||
.recode_to_image_size(context, msg.get_filename(), &mut maybe_sticker)
|
||||
.await?;
|
||||
msg.param.set(Param::Filename, new_name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user