mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
Set autodelete timer columns for outgoing messages
This commit is contained in:
@@ -882,12 +882,16 @@ impl Chat {
|
||||
);
|
||||
}
|
||||
|
||||
// get autodelete timer
|
||||
let autodelete_timer = Some(get_autodelete_timer(context, self.id)).filter(|&x| x != 0);
|
||||
let autodelete_timestamp = autodelete_timer.map(|x| timestamp + i64::from(x));
|
||||
|
||||
// add message to the database
|
||||
|
||||
if sql::execute(
|
||||
context,
|
||||
&context.sql,
|
||||
"INSERT INTO msgs (rfc724_mid, chat_id, from_id, to_id, timestamp, type, state, txt, param, hidden, mime_in_reply_to, mime_references, location_id) VALUES (?,?,?,?,?, ?,?,?,?,?, ?,?,?);",
|
||||
"INSERT INTO msgs (rfc724_mid, chat_id, from_id, to_id, timestamp, type, state, txt, param, hidden, mime_in_reply_to, mime_references, location_id, autodelete_timer, autodelete_timestamp) VALUES (?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?);",
|
||||
params![
|
||||
new_rfc724_mid,
|
||||
self.id,
|
||||
@@ -902,6 +906,8 @@ impl Chat {
|
||||
new_in_reply_to,
|
||||
new_references,
|
||||
location_id as i32,
|
||||
autodelete_timer,
|
||||
autodelete_timestamp
|
||||
]
|
||||
).is_ok() {
|
||||
msg_id = sql::get_rowid(
|
||||
|
||||
Reference in New Issue
Block a user