diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 73952ba8b..fa5bfef92 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -438,6 +438,8 @@ impl MimeMessage { typ: Viewtype::Text, msg_raw: Some(txt.clone()), msg: txt, + // Don't change the error prefix for now, + // receive_imf.rs:lookup_chat_by_reply() checks it. error: Some(format!("Decrypting failed: {err:#}")), ..Default::default() }; diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 2f3acc1b1..889bb1175 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -1411,7 +1411,16 @@ async fn lookup_chat_by_reply( if let Some(parent) = parent { let parent_chat = Chat::load_from_db(context, parent.chat_id).await?; - if parent.download_state != DownloadState::Done { + if parent.download_state != DownloadState::Done + // TODO (2023-09-12): Added for backward compatibility with versions that did not have + // `DownloadState::Undecipherable`. Remove eventually with the comment in + // `MimeMessage::from_bytes()`. + || parent + .error + .as_ref() + .filter(|e| e.starts_with("Decrypting failed:")) + .is_some() + { // If the parent msg is not fully downloaded or undecipherable, it may have been // assigned to the wrong chat (they often get assigned to the 1:1 chat with the sender). return Ok(None);