fix: Decide on filename used for sending depending on the original Viewtype

If a user attaches an image as `File`, we should send the original filename. And vice versa, if it's
`Image` originally, we mustn't reveal the filename.

The filename used for sending is now also saved to the db, so all the sender's devices will display
the same filename in the message info.
This commit is contained in:
iequidoo
2025-07-08 06:22:28 -03:00
committed by iequidoo
parent acba27a328
commit 75b7bea78f
4 changed files with 64 additions and 80 deletions

View File

@@ -499,7 +499,7 @@ impl<'a> BlobObject<'a> {
if !is_avatar && no_exif {
error!(
context,
"Cannot recode image, using original data and file name: {err:#}.",
"Cannot recode image, using original data: {err:#}.",
);
*viewtype = Viewtype::File;
Ok(original_name)