mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +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:
@@ -21,6 +21,9 @@ pub enum Param {
|
||||
/// For messages and jobs
|
||||
File = b'f',
|
||||
|
||||
/// For messages: original filename (as shown in chat)
|
||||
Filename = b'v',
|
||||
|
||||
/// For messages: This name should be shown instead of contact.get_display_name()
|
||||
/// (used if this is a mailinglist
|
||||
/// or explicitly set using set_override_sender_name(), eg. by bots)
|
||||
@@ -528,7 +531,7 @@ mod tests {
|
||||
|
||||
fs::write(fname, b"boo").await.unwrap();
|
||||
let blob = p.get_blob(Param::File, &t, true).await.unwrap().unwrap();
|
||||
assert_eq!(blob, BlobObject::from_name(&t, "foo".to_string()).unwrap());
|
||||
assert!(blob.as_file_name().starts_with("foo"));
|
||||
|
||||
// Blob in blobdir, expect blob.
|
||||
let bar_path = t.get_blobdir().join("bar");
|
||||
|
||||
Reference in New Issue
Block a user