Change type of `dc_mimeparser_t.type_0' to constants::Viewtype

Adjust use sites accordingly.
This commit is contained in:
Dmitry Bogatov
2019-08-26 21:05:36 +00:00
committed by Floris Bruynooghe
parent 47c0526026
commit 86eb9cc058
2 changed files with 46 additions and 41 deletions

View File

@@ -644,7 +644,7 @@ unsafe fn add_parts(
state = MessageState::InNoticed;
}
}
if part.type_0 == Viewtype::Text as i32 {
if part.type_0 == Viewtype::Text {
txt_raw = dc_mprintf(
b"%s\n\n%s\x00" as *const u8 as *const libc::c_char,
if !mime_parser.subject.is_null() {
@@ -1350,7 +1350,7 @@ unsafe fn create_or_lookup_group(
ok = 1
} else {
for part in &mut mime_parser.parts {
if part.type_0 == 20 {
if part.type_0 == Viewtype::Image {
grpimage = part
.param
.get(Param::File)
@@ -1860,7 +1860,7 @@ unsafe fn set_better_msg<T: AsRef<str>>(mime_parser: &mut dc_mimeparser_t, bette
let msg = better_msg.as_ref();
if msg.len() > 0 && !mime_parser.parts.is_empty() {
let part = &mut mime_parser.parts[0];
if (*part).type_0 == 10 {
if (*part).type_0 == Viewtype::Text {
free(part.msg as *mut libc::c_void);
part.msg = msg.strdup();
}