pub(crate) async fn receive_imf_inner(
context: &Context,
folder: &str,
uidvalidity: u32,
uid: u32,
rfc724_mid: &str,
imf_raw: &[u8],
seen: bool,
partial: Option<(u32, Option<String>)>,
) -> Result<Option<ReceivedMsg>>
Expand description
Receive a message and add it to the database.
Returns an error on database failure or if the message is broken, e.g. has nonstandard MIME structure.
If possible, creates a database entry to prevent the message from being
downloaded again, sets chat_id=DC_CHAT_ID_TRASH
and returns Ok(Some(…))
.
If the message is so wrong that we didn’t even create a database entry,
returns Ok(None)
.
If partial
is set, it contains the full message size in bytes and an optional error text for
the partially downloaded message.