mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
factory.rfc724_mid is a String now (instead of C-Char*)
This commit is contained in:
@@ -36,7 +36,7 @@ pub struct dc_mimefactory_t<'a> {
|
|||||||
pub recipients_names: *mut clist,
|
pub recipients_names: *mut clist,
|
||||||
pub recipients_addr: *mut clist,
|
pub recipients_addr: *mut clist,
|
||||||
pub timestamp: i64,
|
pub timestamp: i64,
|
||||||
pub rfc724_mid: *mut libc::c_char,
|
pub rfc724_mid: String,
|
||||||
pub loaded: dc_mimefactory_loaded_t,
|
pub loaded: dc_mimefactory_loaded_t,
|
||||||
pub msg: Message,
|
pub msg: Message,
|
||||||
pub chat: Option<Chat>,
|
pub chat: Option<Chat>,
|
||||||
@@ -57,7 +57,6 @@ impl<'a> Drop for dc_mimefactory_t<'a> {
|
|||||||
unsafe {
|
unsafe {
|
||||||
free(self.from_addr as *mut libc::c_void);
|
free(self.from_addr as *mut libc::c_void);
|
||||||
free(self.from_displayname as *mut libc::c_void);
|
free(self.from_displayname as *mut libc::c_void);
|
||||||
free(self.rfc724_mid as *mut libc::c_void);
|
|
||||||
if !self.recipients_names.is_null() {
|
if !self.recipients_names.is_null() {
|
||||||
clist_free_content(self.recipients_names);
|
clist_free_content(self.recipients_names);
|
||||||
clist_free(self.recipients_names);
|
clist_free(self.recipients_names);
|
||||||
@@ -98,7 +97,7 @@ pub unsafe fn dc_mimefactory_load_msg(
|
|||||||
recipients_names: clist_new(),
|
recipients_names: clist_new(),
|
||||||
recipients_addr: clist_new(),
|
recipients_addr: clist_new(),
|
||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
rfc724_mid: ptr::null_mut(),
|
rfc724_mid: String::default(),
|
||||||
loaded: DC_MF_NOTHING_LOADED,
|
loaded: DC_MF_NOTHING_LOADED,
|
||||||
msg,
|
msg,
|
||||||
chat: Some(chat),
|
chat: Some(chat),
|
||||||
@@ -232,7 +231,7 @@ pub unsafe fn dc_mimefactory_load_msg(
|
|||||||
|
|
||||||
factory.loaded = DC_MF_MSG_LOADED;
|
factory.loaded = DC_MF_MSG_LOADED;
|
||||||
factory.timestamp = factory.msg.timestamp_sort;
|
factory.timestamp = factory.msg.timestamp_sort;
|
||||||
factory.rfc724_mid = dc_strdup(factory.msg.rfc724_mid);
|
factory.rfc724_mid = as_str(factory.msg.rfc724_mid).to_string();
|
||||||
factory.increation = dc_msg_is_increation(&factory.msg);
|
factory.increation = dc_msg_is_increation(&factory.msg);
|
||||||
|
|
||||||
Ok(factory)
|
Ok(factory)
|
||||||
@@ -288,7 +287,7 @@ pub unsafe fn dc_mimefactory_load_mdn<'a>(
|
|||||||
recipients_names: clist_new(),
|
recipients_names: clist_new(),
|
||||||
recipients_addr: clist_new(),
|
recipients_addr: clist_new(),
|
||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
rfc724_mid: ptr::null_mut(),
|
rfc724_mid: String::default(),
|
||||||
loaded: DC_MF_NOTHING_LOADED,
|
loaded: DC_MF_NOTHING_LOADED,
|
||||||
msg,
|
msg,
|
||||||
chat: None,
|
chat: None,
|
||||||
@@ -330,7 +329,7 @@ pub unsafe fn dc_mimefactory_load_mdn<'a>(
|
|||||||
);
|
);
|
||||||
load_from(&mut factory);
|
load_from(&mut factory);
|
||||||
factory.timestamp = dc_create_smeared_timestamp(factory.context);
|
factory.timestamp = dc_create_smeared_timestamp(factory.context);
|
||||||
factory.rfc724_mid = dc_create_outgoing_rfc724_mid(None, as_str(factory.from_addr)).strdup();
|
factory.rfc724_mid = dc_create_outgoing_rfc724_mid(None, as_str(factory.from_addr));
|
||||||
factory.loaded = DC_MF_MDN_LOADED;
|
factory.loaded = DC_MF_MDN_LOADED;
|
||||||
|
|
||||||
Ok(factory)
|
Ok(factory)
|
||||||
@@ -447,7 +446,7 @@ pub unsafe fn dc_mimefactory_render(context: &Context, factory: &mut dc_mimefact
|
|||||||
to,
|
to,
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
dc_strdup(factory.rfc724_mid),
|
factory.rfc724_mid.strdup(),
|
||||||
in_reply_to_list,
|
in_reply_to_list,
|
||||||
references_list,
|
references_list,
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
|
|||||||
@@ -1001,8 +1001,7 @@ fn add_smtp_job(context: &Context, action: Action, mimefactory: &dc_mimefactory_
|
|||||||
let mut success: libc::c_int = 0i32;
|
let mut success: libc::c_int = 0i32;
|
||||||
let mut recipients: *mut libc::c_char = ptr::null_mut();
|
let mut recipients: *mut libc::c_char = ptr::null_mut();
|
||||||
let mut param = Params::new();
|
let mut param = Params::new();
|
||||||
let path_filename =
|
let path_filename = dc_get_fine_path_filename(context, "$BLOBDIR", &mimefactory.rfc724_mid);
|
||||||
dc_get_fine_path_filename(context, "$BLOBDIR", as_str(mimefactory.rfc724_mid));
|
|
||||||
let bytes = unsafe {
|
let bytes = unsafe {
|
||||||
std::slice::from_raw_parts(
|
std::slice::from_raw_parts(
|
||||||
(*mimefactory.out).str_0 as *const u8,
|
(*mimefactory.out).str_0 as *const u8,
|
||||||
@@ -1013,7 +1012,7 @@ fn add_smtp_job(context: &Context, action: Action, mimefactory: &dc_mimefactory_
|
|||||||
error!(
|
error!(
|
||||||
context,
|
context,
|
||||||
"Could not write message <{}> to \"{}\".",
|
"Could not write message <{}> to \"{}\".",
|
||||||
to_string(mimefactory.rfc724_mid),
|
mimefactory.rfc724_mid,
|
||||||
path_filename.display(),
|
path_filename.display(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user