mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
fix: forward message with file (#7755)
resolves #7724: When forwarding a message with file to another profile, the file was not copied to the target $blobdir and so the forwarded message missed it --------- Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
@@ -4380,7 +4380,14 @@ pub async fn forward_msgs_2ctx(
|
||||
}
|
||||
|
||||
let param = &mut param;
|
||||
msg.param.steal(param, Param::File);
|
||||
|
||||
// When forwarding between different accounts, blob files must be physically copied
|
||||
// because each account has its own blob directory.
|
||||
if let Some(src_path) = param.get_file_path(ctx_src)? {
|
||||
let new_blob = BlobObject::create_and_deduplicate(ctx_dst, &src_path, &src_path)
|
||||
.context("Failed to copy blob file to destination account")?;
|
||||
msg.param.set(Param::File, new_blob.as_name());
|
||||
}
|
||||
msg.param.steal(param, Param::Filename);
|
||||
msg.param.steal(param, Param::Width);
|
||||
msg.param.steal(param, Param::Height);
|
||||
|
||||
Reference in New Issue
Block a user