From 6bcf022523eb0b41db11eee241d175cd9b8007db Mon Sep 17 00:00:00 2001 From: iequidoo Date: Wed, 20 Dec 2023 20:25:02 -0300 Subject: [PATCH] refactor: receive_imf_inner: Rename replace_partial_download to replace_msg_id It's more consistent with `replace_chat_id` and the same as the corresponding parameter name of `add_parts()`. --- src/receive_imf.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/receive_imf.rs b/src/receive_imf.rs index e25d4e071..8ffd88ac0 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -128,7 +128,8 @@ async fn insert_tombstone(context: &Context, rfc724_mid: &str) -> Result /// returns `Ok(None)`. /// /// If `is_partial_download` is set, it contains the full message size in bytes. -/// Do not confuse that with `replace_partial_download` that will be set when the full message is loaded later. +/// Do not confuse that with `replace_msg_id` that will be set when the full message is loaded +/// later. pub(crate) async fn receive_imf_inner( context: &Context, rfc724_mid: &str, @@ -187,7 +188,7 @@ pub(crate) async fn receive_imf_inner( // check, if the mail is already in our database. // make sure, this check is done eg. before securejoin-processing. - let (replace_partial_download, replace_chat_id) = + let (replace_msg_id, replace_chat_id) = if let Some(old_msg_id) = message::rfc724_mid_exists(context, rfc724_mid).await? { let msg = Message::load_from_db(context, old_msg_id).await?; if msg.download_state() != DownloadState::Done && is_partial_download.is_none() { @@ -302,9 +303,9 @@ pub(crate) async fn receive_imf_inner( &to_ids, rfc724_mid, from_id, - seen || replace_partial_download.is_some(), + seen || replace_msg_id.is_some(), is_partial_download, - replace_partial_download, + replace_msg_id, fetching_existing_messages, prevent_rename, verified_encryption,