mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
Return bool from dc_mimefactory_render
This commit is contained in:
@@ -334,11 +334,7 @@ pub unsafe fn dc_mimefactory_load_mdn<'a>(
|
|||||||
Ok(factory)
|
Ok(factory)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO should return bool /rtn
|
pub unsafe fn dc_mimefactory_render(context: &Context, factory: &mut dc_mimefactory_t) -> bool {
|
||||||
pub unsafe fn dc_mimefactory_render(
|
|
||||||
context: &Context,
|
|
||||||
factory: &mut dc_mimefactory_t,
|
|
||||||
) -> libc::c_int {
|
|
||||||
let subject: *mut mailimf_subject;
|
let subject: *mut mailimf_subject;
|
||||||
let mut ok_to_continue = true;
|
let mut ok_to_continue = true;
|
||||||
let imf_fields: *mut mailimf_fields;
|
let imf_fields: *mut mailimf_fields;
|
||||||
@@ -348,7 +344,7 @@ pub unsafe fn dc_mimefactory_render(
|
|||||||
let mut subject_str: *mut libc::c_char = ptr::null_mut();
|
let mut subject_str: *mut libc::c_char = ptr::null_mut();
|
||||||
let mut afwd_email: libc::c_int = 0;
|
let mut afwd_email: libc::c_int = 0;
|
||||||
let mut col: libc::c_int = 0;
|
let mut col: libc::c_int = 0;
|
||||||
let mut success: libc::c_int = 0;
|
let mut success = false;
|
||||||
let mut parts: libc::c_int = 0;
|
let mut parts: libc::c_int = 0;
|
||||||
let mut e2ee_guaranteed: libc::c_int = 0;
|
let mut e2ee_guaranteed: libc::c_int = 0;
|
||||||
let mut min_verified: libc::c_int = 0;
|
let mut min_verified: libc::c_int = 0;
|
||||||
@@ -1046,7 +1042,7 @@ pub unsafe fn dc_mimefactory_render(
|
|||||||
}
|
}
|
||||||
factory.out = mmap_string_new(b"\x00" as *const u8 as *const libc::c_char);
|
factory.out = mmap_string_new(b"\x00" as *const u8 as *const libc::c_char);
|
||||||
mailmime_write_mem(factory.out, &mut col, message);
|
mailmime_write_mem(factory.out, &mut col, message);
|
||||||
success = 1;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ pub unsafe fn job_send_msg(context: &Context, msg_id: uint32_t) -> libc::c_int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* create message */
|
/* create message */
|
||||||
if 0 == dc_mimefactory_render(context, &mut mimefactory) {
|
if !dc_mimefactory_render(context, &mut mimefactory) {
|
||||||
dc_set_msg_failed(context, msg_id, as_opt_str(mimefactory.error));
|
dc_set_msg_failed(context, msg_id, as_opt_str(mimefactory.error));
|
||||||
} else if 0
|
} else if 0
|
||||||
!= mimefactory
|
!= mimefactory
|
||||||
@@ -990,7 +990,7 @@ fn connect_to_inbox(context: &Context, inbox: &Imap) -> libc::c_int {
|
|||||||
|
|
||||||
fn send_mdn(context: &Context, msg_id: uint32_t) {
|
fn send_mdn(context: &Context, msg_id: uint32_t) {
|
||||||
if let Ok(mut mimefactory) = unsafe { dc_mimefactory_load_mdn(context, msg_id) } {
|
if let Ok(mut mimefactory) = unsafe { dc_mimefactory_load_mdn(context, msg_id) } {
|
||||||
if 0 != unsafe { dc_mimefactory_render(context, &mut mimefactory) } {
|
if unsafe { dc_mimefactory_render(context, &mut mimefactory) } {
|
||||||
add_smtp_job(context, Action::SendMdn, &mut mimefactory);
|
add_smtp_job(context, Action::SendMdn, &mut mimefactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user