fix: update passed by reference Message in prepare_msg_raw()

This commit is contained in:
link2xt
2023-07-08 23:23:42 +00:00
parent a74b00c3f9
commit dc4396a699

View File

@@ -1713,6 +1713,11 @@ impl Chat {
None None
}; };
msg.chat_id = self.id;
msg.from_id = ContactId::SELF;
msg.rfc724_mid = new_rfc724_mid;
msg.timestamp_sort = timestamp;
// add message to the database // add message to the database
if let Some(update_msg_id) = update_msg_id { if let Some(update_msg_id) = update_msg_id {
context context
@@ -1726,11 +1731,11 @@ impl Chat {
ephemeral_timestamp=? ephemeral_timestamp=?
WHERE id=?;", WHERE id=?;",
params_slice![ params_slice![
new_rfc724_mid, msg.rfc724_mid,
self.id, msg.chat_id,
ContactId::SELF, msg.from_id,
to_id, to_id,
timestamp, msg.timestamp_sort,
msg.viewtype, msg.viewtype,
msg.state, msg.state,
msg.text, msg.text,
@@ -1775,11 +1780,11 @@ impl Chat {
ephemeral_timestamp) ephemeral_timestamp)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1,?,?,?);", VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1,?,?,?);",
params_slice![ params_slice![
new_rfc724_mid, msg.rfc724_mid,
self.id, msg.chat_id,
ContactId::SELF, msg.from_id,
to_id, to_id,
timestamp, msg.timestamp_sort,
msg.viewtype, msg.viewtype,
msg.state, msg.state,
msg.text, msg.text,