mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
Store In-Reply-To header as Option<String>
This commit is contained in:
@@ -151,7 +151,7 @@ pub struct Message {
|
|||||||
pub timestamp_rcvd: i64,
|
pub timestamp_rcvd: i64,
|
||||||
pub text: Option<String>,
|
pub text: Option<String>,
|
||||||
pub rfc724_mid: *mut libc::c_char,
|
pub rfc724_mid: *mut libc::c_char,
|
||||||
pub in_reply_to: *mut libc::c_char,
|
pub in_reply_to: Option<String>,
|
||||||
pub server_folder: Option<String>,
|
pub server_folder: Option<String>,
|
||||||
pub server_uid: u32,
|
pub server_uid: u32,
|
||||||
// TODO: enum
|
// TODO: enum
|
||||||
@@ -322,7 +322,7 @@ pub fn dc_msg_new(viewtype: Viewtype) -> Message {
|
|||||||
timestamp_rcvd: 0,
|
timestamp_rcvd: 0,
|
||||||
text: None,
|
text: None,
|
||||||
rfc724_mid: std::ptr::null_mut(),
|
rfc724_mid: std::ptr::null_mut(),
|
||||||
in_reply_to: std::ptr::null_mut(),
|
in_reply_to: None,
|
||||||
server_folder: None,
|
server_folder: None,
|
||||||
server_uid: 0,
|
server_uid: 0,
|
||||||
is_dc_message: 0,
|
is_dc_message: 0,
|
||||||
@@ -337,7 +337,6 @@ impl Drop for Message {
|
|||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
free(self.rfc724_mid.cast());
|
free(self.rfc724_mid.cast());
|
||||||
free(self.in_reply_to.cast());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -439,10 +438,7 @@ pub fn dc_msg_load_from_db(context: &Context, id: u32) -> Result<Message, Error>
|
|||||||
let mut msg = dc_msg_new_untyped();
|
let mut msg = dc_msg_new_untyped();
|
||||||
msg.id = row.get::<_, i32>(0)? as u32;
|
msg.id = row.get::<_, i32>(0)? as u32;
|
||||||
msg.rfc724_mid = row.get::<_, String>(1)?.strdup();
|
msg.rfc724_mid = row.get::<_, String>(1)?.strdup();
|
||||||
msg.in_reply_to = match row.get::<_, Option<String>>(2)? {
|
msg.in_reply_to = row.get::<_, Option<String>>(2)?;
|
||||||
Some(s) => s.strdup(),
|
|
||||||
None => std::ptr::null_mut(),
|
|
||||||
};
|
|
||||||
msg.server_folder = row.get::<_, Option<String>>(3)?;
|
msg.server_folder = row.get::<_, Option<String>>(3)?;
|
||||||
msg.server_uid = row.get(4)?;
|
msg.server_uid = row.get(4)?;
|
||||||
msg.move_state = row.get(5)?;
|
msg.move_state = row.get(5)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user