feat: Deduplicate blob files in chat.rs, config.rs, and integration.rs

These were the last places in the `deltachat` crate where files were
stored without deduplication. The CFFI python bindings are the last
thing that's still missing.
This commit is contained in:
Hocuri
2025-01-24 20:08:20 +01:00
parent 1fd6d80e6d
commit e6ea09641a
5 changed files with 19 additions and 8 deletions

View File

@@ -764,7 +764,8 @@ impl Context {
.await?;
match value {
Some(path) => {
let mut blob = BlobObject::new_from_path(self, path.as_ref()).await?;
let path = get_abs_path(self, Path::new(path));
let mut blob = BlobObject::create_and_deduplicate(self, &path, &path)?;
blob.recode_to_avatar_size(self).await?;
self.sql
.set_raw_config(key.as_ref(), Some(blob.as_name()))