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:
Nico de Haen
2026-01-22 21:15:26 +01:00
committed by GitHub
parent a6b2a54e46
commit a6baba1852
2 changed files with 99 additions and 1 deletions

View File

@@ -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);