cargo fmt

This commit is contained in:
holger krekel
2019-08-17 01:30:21 +02:00
parent 64beb17fa6
commit 799d362654

View File

@@ -1152,36 +1152,33 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
} }
} }
if ok_to_continue { if ok_to_continue {
/* check header directly as is_send_by_messenger is not yet set up */ /* check header directly as is_send_by_messenger is not yet set up */
let is_msgrmsg = (!dc_mimeparser_lookup_optional_field( let is_msgrmsg =
&mimeparser, (!dc_mimeparser_lookup_optional_field(&mimeparser, "Chat-Version")
"Chat-Version", .is_null()) as libc::c_int;
)
.is_null())
as libc::c_int;
let simplified_txt = simplifier.unwrap().simplify( let simplified_txt = simplifier.unwrap().simplify(
decoded_data, decoded_data,
decoded_data_bytes as libc::c_int, decoded_data_bytes as libc::c_int,
mime_type == 70i32, mime_type == 70i32,
is_msgrmsg, is_msgrmsg,
); );
if !simplified_txt.is_null() if !simplified_txt.is_null()
&& 0 != *simplified_txt.offset(0isize) as libc::c_int && 0 != *simplified_txt.offset(0isize) as libc::c_int
{ {
let mut part = dc_mimepart_new(); let mut part = dc_mimepart_new();
part.type_0 = 10i32; part.type_0 = 10i32;
part.int_mimetype = mime_type; part.int_mimetype = mime_type;
part.msg = simplified_txt; part.msg = simplified_txt;
part.msg_raw = part.msg_raw =
strndup(decoded_data, decoded_data_bytes as libc::c_ulong); strndup(decoded_data, decoded_data_bytes as libc::c_ulong);
do_add_single_part(mimeparser, part); do_add_single_part(mimeparser, part);
} else { } else {
free(simplified_txt as *mut libc::c_void); free(simplified_txt as *mut libc::c_void);
} }
if simplifier.unwrap().is_forwarded { if simplifier.unwrap().is_forwarded {
mimeparser.is_forwarded = 1i32 mimeparser.is_forwarded = 1i32
} }
} }
} }
80 | 90 | 100 | 110 | 111 => { 80 | 90 | 100 | 110 | 111 => {
@@ -1288,54 +1285,54 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
} }
} }
if ok_to_continue { if ok_to_continue {
if strncmp( if strncmp(
desired_filename, desired_filename,
b"location\x00" as *const u8 as *const libc::c_char, b"location\x00" as *const u8 as *const libc::c_char,
8, 8,
) == 0i32
&& strncmp(
desired_filename
.offset(strlen(desired_filename) as isize)
.offset(-4isize),
b".kml\x00" as *const u8 as *const libc::c_char,
4,
) == 0i32 ) == 0i32
&& strncmp( {
desired_filename mimeparser.location_kml = Some(dc_kml_parse(
.offset(strlen(desired_filename) as isize) mimeparser.context,
.offset(-4isize), decoded_data,
b".kml\x00" as *const u8 as *const libc::c_char, decoded_data_bytes,
4, ));
) == 0i32 } else if strncmp(
{ desired_filename,
mimeparser.location_kml = Some(dc_kml_parse( b"message\x00" as *const u8 as *const libc::c_char,
mimeparser.context, 7,
decoded_data, ) == 0i32
decoded_data_bytes, && strncmp(
)); desired_filename
} else if strncmp( .offset(strlen(desired_filename) as isize)
desired_filename, .offset(-4isize),
b"message\x00" as *const u8 as *const libc::c_char, b".kml\x00" as *const u8 as *const libc::c_char,
7, 4,
) == 0i32 ) == 0i32
&& strncmp( {
desired_filename mimeparser.message_kml = Some(dc_kml_parse(
.offset(strlen(desired_filename) as isize) mimeparser.context,
.offset(-4isize), decoded_data,
b".kml\x00" as *const u8 as *const libc::c_char, decoded_data_bytes,
4, ));
) == 0i32 } else {
{ dc_replace_bad_utf8_chars(desired_filename);
mimeparser.message_kml = Some(dc_kml_parse( do_add_single_file_part(
mimeparser.context, mimeparser,
decoded_data, msg_type,
decoded_data_bytes, mime_type,
)); raw_mime,
} else { decoded_data,
dc_replace_bad_utf8_chars(desired_filename); decoded_data_bytes,
do_add_single_file_part( desired_filename,
mimeparser, );
msg_type, }
mime_type,
raw_mime,
decoded_data,
decoded_data_bytes,
desired_filename,
);
}
} }
} }
_ => {} _ => {}