pub(crate) async fn receive_imf_inner(
    context: &Context,
    folder: &str,
    uidvalidity: u32,
    uid: u32,
    rfc724_mid: &str,
    imf_raw: &[u8],
    seen: bool,
    is_partial_download: Option<u32>,
    fetching_existing_messages: bool
) -> 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 is_partial_download is set, it contains the full message size in bytes. Do not confuse that with replace_msg_id that will be set when the full message is loaded later.