mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 20:06:30 +03:00
fix: Ensure that message being sent is added to the bottom (#8027)
This commit is contained in:
14
src/chat.rs
14
src/chat.rs
@@ -2910,11 +2910,23 @@ pub(crate) async fn create_send_msg_jobs(context: &Context, msg: &mut Message) -
|
|||||||
msg.param.remove(Param::GuaranteeE2ee);
|
msg.param.remove(Param::GuaranteeE2ee);
|
||||||
}
|
}
|
||||||
msg.subject.clone_from(&rendered_msg.subject);
|
msg.subject.clone_from(&rendered_msg.subject);
|
||||||
|
// Sort the message to the bottom. Employ `msgs_index7` to compute `timestamp`.
|
||||||
context
|
context
|
||||||
.sql
|
.sql
|
||||||
.execute(
|
.execute(
|
||||||
"UPDATE msgs SET pre_rfc724_mid=?, subject=?, param=? WHERE id=?",
|
"
|
||||||
|
UPDATE msgs SET
|
||||||
|
timestamp=(
|
||||||
|
SELECT MAX(timestamp) FROM msgs WHERE
|
||||||
|
state IN(10,13,16,18,20,24,26,28) AND
|
||||||
|
hidden IN(0,1) AND
|
||||||
|
chat_id=?
|
||||||
|
),
|
||||||
|
pre_rfc724_mid=?, subject=?, param=?
|
||||||
|
WHERE id=?
|
||||||
|
",
|
||||||
(
|
(
|
||||||
|
msg.chat_id,
|
||||||
&msg.pre_rfc724_mid,
|
&msg.pre_rfc724_mid,
|
||||||
&msg.subject,
|
&msg.subject,
|
||||||
msg.param.to_string(),
|
msg.param.to_string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user