fix: add device message instead of partial message when receive_imf fails

This commit is contained in:
link2xt
2025-11-04 23:32:45 +00:00
committed by l
parent f04c881b8c
commit 81ba2d20d6
5 changed files with 33 additions and 77 deletions

View File

@@ -240,12 +240,11 @@ const MIME_AC_SETUP_FILE: &str = "application/autocrypt-setup";
impl MimeMessage {
/// Parse a mime message.
///
/// If `partial` is set, it contains the full message size in bytes and an optional error text
/// for the partially downloaded message, and `body` contains the HEADER only.
/// If `partial` is set, it contains the full message size in bytes.
pub(crate) async fn from_bytes(
context: &Context,
body: &[u8],
partial: Option<(u32, Option<String>)>,
partial: Option<u32>,
) -> Result<Self> {
let mail = mailparse::parse_mail(body)?;
@@ -619,9 +618,9 @@ impl MimeMessage {
};
match partial {
Some((org_bytes, err)) => {
Some(org_bytes) => {
parser
.create_stub_from_partial_download(context, org_bytes, err)
.create_stub_from_partial_download(context, org_bytes)
.await?;
}
None => match mail {