mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 01:46:34 +03:00
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:
@@ -1,3 +1,5 @@
|
||||
use std::path::Path;
|
||||
|
||||
use crate::chat::{send_msg, ChatId};
|
||||
use crate::config::Config;
|
||||
use crate::contact::ContactId;
|
||||
@@ -13,7 +15,7 @@ impl Context {
|
||||
pub async fn set_webxdc_integration(&self, file: &str) -> Result<()> {
|
||||
let chat_id = ChatId::create_for_contact(self, ContactId::SELF).await?;
|
||||
let mut msg = Message::new(Viewtype::Webxdc);
|
||||
msg.set_file(file, None);
|
||||
msg.set_file_and_deduplicate(self, Path::new(&file), None, None)?;
|
||||
msg.hidden = true;
|
||||
msg.param.set_int(Param::WebxdcIntegration, 1);
|
||||
msg.param.set_int(Param::GuaranteeE2ee, 1); // needed to pass `internet_access` requirements
|
||||
|
||||
Reference in New Issue
Block a user