mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +03:00
Add autodelete timer and timestamp to message info
This commit is contained in:
@@ -247,6 +247,8 @@ pub struct Message {
|
|||||||
pub(crate) timestamp_sort: i64,
|
pub(crate) timestamp_sort: i64,
|
||||||
pub(crate) timestamp_sent: i64,
|
pub(crate) timestamp_sent: i64,
|
||||||
pub(crate) timestamp_rcvd: i64,
|
pub(crate) timestamp_rcvd: i64,
|
||||||
|
pub(crate) autodelete_timer: Option<i64>,
|
||||||
|
pub(crate) autodelete_timestamp: Option<i64>,
|
||||||
pub(crate) text: Option<String>,
|
pub(crate) text: Option<String>,
|
||||||
pub(crate) rfc724_mid: String,
|
pub(crate) rfc724_mid: String,
|
||||||
pub(crate) in_reply_to: Option<String>,
|
pub(crate) in_reply_to: Option<String>,
|
||||||
@@ -288,6 +290,8 @@ impl Message {
|
|||||||
" m.timestamp AS timestamp,",
|
" m.timestamp AS timestamp,",
|
||||||
" m.timestamp_sent AS timestamp_sent,",
|
" m.timestamp_sent AS timestamp_sent,",
|
||||||
" m.timestamp_rcvd AS timestamp_rcvd,",
|
" m.timestamp_rcvd AS timestamp_rcvd,",
|
||||||
|
" m.autodelete_timer AS autodelete_timer,",
|
||||||
|
" m.autodelete_timestamp AS autodelete_timestamp,",
|
||||||
" m.type AS type,",
|
" m.type AS type,",
|
||||||
" m.state AS state,",
|
" m.state AS state,",
|
||||||
" m.msgrmsg AS msgrmsg,",
|
" m.msgrmsg AS msgrmsg,",
|
||||||
@@ -315,6 +319,8 @@ impl Message {
|
|||||||
msg.timestamp_sort = row.get("timestamp")?;
|
msg.timestamp_sort = row.get("timestamp")?;
|
||||||
msg.timestamp_sent = row.get("timestamp_sent")?;
|
msg.timestamp_sent = row.get("timestamp_sent")?;
|
||||||
msg.timestamp_rcvd = row.get("timestamp_rcvd")?;
|
msg.timestamp_rcvd = row.get("timestamp_rcvd")?;
|
||||||
|
msg.autodelete_timer = row.get("autodelete_timer")?;
|
||||||
|
msg.autodelete_timestamp = row.get("autodelete_timestamp")?;
|
||||||
msg.viewtype = row.get("type")?;
|
msg.viewtype = row.get("type")?;
|
||||||
msg.state = row.get("state")?;
|
msg.state = row.get("state")?;
|
||||||
msg.is_dc_message = row.get("msgrmsg")?;
|
msg.is_dc_message = row.get("msgrmsg")?;
|
||||||
@@ -865,6 +871,19 @@ pub fn get_msg_info(context: &Context, msg_id: MsgId) -> String {
|
|||||||
ret += "\n";
|
ret += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(autodelete_timer) = msg.autodelete_timer {
|
||||||
|
if autodelete_timer != 0 {
|
||||||
|
ret += &format!("Autodelete timer: {}\n", autodelete_timer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(autodelete_timestamp) = msg.autodelete_timestamp {
|
||||||
|
ret += &format!(
|
||||||
|
"Expires: {}\n",
|
||||||
|
dc_timestamp_to_str(autodelete_timestamp)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if msg.from_id == DC_CONTACT_ID_INFO || msg.to_id == DC_CONTACT_ID_INFO {
|
if msg.from_id == DC_CONTACT_ID_INFO || msg.to_id == DC_CONTACT_ID_INFO {
|
||||||
// device-internal message, no further details needed
|
// device-internal message, no further details needed
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user