mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
Rename dc_simplify_t into Simplify
This commit is contained in:
committed by
holger krekel
parent
14ce55b1a8
commit
64051fca10
@@ -1112,7 +1112,7 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
|
|||||||
/* must not be free()'d */
|
/* must not be free()'d */
|
||||||
let mut decoded_data: *const libc::c_char = 0 as *const libc::c_char;
|
let mut decoded_data: *const libc::c_char = 0 as *const libc::c_char;
|
||||||
let mut decoded_data_bytes = 0;
|
let mut decoded_data_bytes = 0;
|
||||||
let mut simplifier: Option<dc_simplify_t> = None;
|
let mut simplifier: Option<Simplify> = None;
|
||||||
if !(mime.is_null() || (*mime).mm_data.mm_single.is_null()) {
|
if !(mime.is_null() || (*mime).mm_data.mm_single.is_null()) {
|
||||||
mime_type = mailmime_get_mime_type(mime, &mut msg_type, &mut raw_mime);
|
mime_type = mailmime_get_mime_type(mime, &mut msg_type, &mut raw_mime);
|
||||||
mime_data = (*mime).mm_data.mm_single;
|
mime_data = (*mime).mm_data.mm_single;
|
||||||
@@ -1134,7 +1134,7 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
|
|||||||
match mime_type {
|
match mime_type {
|
||||||
60 | 70 => {
|
60 | 70 => {
|
||||||
if simplifier.is_none() {
|
if simplifier.is_none() {
|
||||||
simplifier = Some(dc_simplify_t::new());
|
simplifier = Some(Simplify::new());
|
||||||
}
|
}
|
||||||
/* get from `Content-Type: text/...; charset=utf-8`; must not be free()'d */
|
/* get from `Content-Type: text/...; charset=utf-8`; must not be free()'d */
|
||||||
let charset = mailmime_content_charset_get((*mime).mm_content_type);
|
let charset = mailmime_content_charset_get((*mime).mm_content_type);
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ use crate::dc_tools::*;
|
|||||||
use crate::x::*;
|
use crate::x::*;
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct dc_simplify_t {
|
pub struct Simplify {
|
||||||
pub is_forwarded: libc::c_int,
|
pub is_forwarded: libc::c_int,
|
||||||
pub is_cut_at_begin: libc::c_int,
|
pub is_cut_at_begin: libc::c_int,
|
||||||
pub is_cut_at_end: libc::c_int,
|
pub is_cut_at_end: libc::c_int,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl dc_simplify_t {
|
impl Simplify {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
dc_simplify_t {
|
Simplify {
|
||||||
is_forwarded: 0,
|
is_forwarded: 0,
|
||||||
is_cut_at_begin: 0,
|
is_cut_at_begin: 0,
|
||||||
is_cut_at_end: 0,
|
is_cut_at_end: 0,
|
||||||
@@ -267,7 +267,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_simplify_trim() {
|
fn test_simplify_trim() {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut simplify = dc_simplify_t::new();
|
let mut simplify = Simplify::new();
|
||||||
let html: *const libc::c_char =
|
let html: *const libc::c_char =
|
||||||
b"\r\r\nline1<br>\r\n\r\n\r\rline2\n\r\x00" as *const u8 as *const libc::c_char;
|
b"\r\r\nline1<br>\r\n\r\n\r\rline2\n\r\x00" as *const u8 as *const libc::c_char;
|
||||||
let plain: *mut libc::c_char =
|
let plain: *mut libc::c_char =
|
||||||
@@ -287,7 +287,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_simplify_parse_href() {
|
fn test_simplify_parse_href() {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut simplify = dc_simplify_t::new();
|
let mut simplify = Simplify::new();
|
||||||
let html: *const libc::c_char =
|
let html: *const libc::c_char =
|
||||||
b"<a href=url>text</a\x00" as *const u8 as *const libc::c_char;
|
b"<a href=url>text</a\x00" as *const u8 as *const libc::c_char;
|
||||||
let plain: *mut libc::c_char =
|
let plain: *mut libc::c_char =
|
||||||
@@ -307,7 +307,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_simplify_bold_text() {
|
fn test_simplify_bold_text() {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut simplify = dc_simplify_t::new();
|
let mut simplify = Simplify::new();
|
||||||
let html: *const libc::c_char =
|
let html: *const libc::c_char =
|
||||||
b"<!DOCTYPE name [<!DOCTYPE ...>]><!-- comment -->text <b><?php echo ... ?>bold</b><![CDATA[<>]]>\x00"
|
b"<!DOCTYPE name [<!DOCTYPE ...>]><!-- comment -->text <b><?php echo ... ?>bold</b><![CDATA[<>]]>\x00"
|
||||||
as *const u8 as *const libc::c_char;
|
as *const u8 as *const libc::c_char;
|
||||||
@@ -328,7 +328,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_simplify_html_encoded() {
|
fn test_simplify_html_encoded() {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut simplify = dc_simplify_t::new();
|
let mut simplify = Simplify::new();
|
||||||
let html: *const libc::c_char =
|
let html: *const libc::c_char =
|
||||||
b"<>"'& äÄöÖüÜß fooÆçÇ ♦&noent;‎‏‌‍\x00"
|
b"<>"'& äÄöÖüÜß fooÆçÇ ♦&noent;‎‏‌‍\x00"
|
||||||
as *const u8 as *const libc::c_char;
|
as *const u8 as *const libc::c_char;
|
||||||
|
|||||||
Reference in New Issue
Block a user