add hop info

add hop info creation

Save it to the db

format and fix clippy

replace `and_then` with simple check

cargo fmt

chage table to get info from
This commit is contained in:
Sebastian
2021-07-08 21:24:13 +02:00
parent 57870ec54a
commit 4fa0edcfbf
5 changed files with 67 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ use crate::blob::BlobObject;
use crate::constants::{Viewtype, DC_DESIRED_TEXT_LEN, DC_ELLIPSE};
use crate::contact::addr_normalize;
use crate::context::Context;
use crate::dc_tools::{dc_get_filemeta, dc_truncate};
use crate::dc_tools::{dc_get_filemeta, dc_truncate, parse_receive_headers};
use crate::dehtml::dehtml;
use crate::e2ee;
use crate::events::EventType;
@@ -76,6 +76,8 @@ pub struct MimeMessage {
/// This is non-empty only if the message was actually encrypted. It is used
/// for e.g. late-parsing HTML.
pub decoded_data: Vec<u8>,
pub(crate) hop_info: String,
}
#[derive(Debug, PartialEq)]
@@ -271,6 +273,8 @@ impl MimeMessage {
footer: None,
is_mime_modified: false,
decoded_data: Vec::new(),
hop_info: parse_receive_headers(&mail.get_headers()),
};
parser.parse_mime_recursive(context, &mail, false).await?;
parser.maybe_remove_bad_parts();