mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 06:46:35 +03:00
feat: Make dc_msg_get_filename() return the original attachment filename (#4309)
It can be used e.g. as a default in the file saving dialog. Also display the original filename in the message info. For these purposes add Param::Filename in addition to Param::File and use it as an attachment filename in sent emails.
This commit is contained in:
@@ -1386,7 +1386,7 @@ async fn build_body_file(
|
||||
.param
|
||||
.get_blob(Param::File, context, true)
|
||||
.await?
|
||||
.context("msg has no filename")?;
|
||||
.context("msg has no file")?;
|
||||
let suffix = blob.suffix().unwrap_or("dat");
|
||||
|
||||
// Get file name to use for sending. For privacy purposes, we do
|
||||
@@ -1431,7 +1431,11 @@ async fn build_body_file(
|
||||
),
|
||||
&suffix
|
||||
),
|
||||
_ => blob.as_file_name().to_string(),
|
||||
_ => msg
|
||||
.param
|
||||
.get(Param::Filename)
|
||||
.unwrap_or_else(|| blob.as_file_name())
|
||||
.to_string(),
|
||||
};
|
||||
|
||||
/* check mimetype */
|
||||
|
||||
Reference in New Issue
Block a user