mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
refactor(simplify): move dehtml dependency to mimeparser
This change also removes unnecessary String clone for HTML messages.
This commit is contained in:
committed by
holger krekel
parent
7f6a1ad1a7
commit
fe4080d59f
@@ -12,6 +12,7 @@ use crate::contact::*;
|
||||
use crate::context::Context;
|
||||
use crate::dc_simplify::*;
|
||||
use crate::dc_tools::*;
|
||||
use crate::dehtml::dehtml;
|
||||
use crate::e2ee;
|
||||
use crate::error::Result;
|
||||
use crate::events::Event;
|
||||
@@ -580,7 +581,12 @@ impl<'a> MimeParser<'a> {
|
||||
("".into(), false)
|
||||
} else {
|
||||
let is_html = mime_type == mime::TEXT_HTML;
|
||||
simplify(&decoded_data, is_html, self.has_chat_version())
|
||||
let out = if is_html {
|
||||
dehtml(&decoded_data)
|
||||
} else {
|
||||
decoded_data.clone()
|
||||
};
|
||||
simplify(out, self.has_chat_version())
|
||||
};
|
||||
|
||||
if !simplified_txt.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user