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
};
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
if let Some(update_msg_id) = update_msg_id {
context
@@ -1726,11 +1731,11 @@ impl Chat {
ephemeral_timestamp=?
WHERE id=?;",
params_slice![
new_rfc724_mid,
self.id,
ContactId::SELF,
msg.rfc724_mid,
msg.chat_id,
msg.from_id,
to_id,
timestamp,
msg.timestamp_sort,
msg.viewtype,
msg.state,
msg.text,
@@ -1775,11 +1780,11 @@ impl Chat {
ephemeral_timestamp)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1,?,?,?);",
params_slice![
new_rfc724_mid,
self.id,
ContactId::SELF,
msg.rfc724_mid,
msg.chat_id,
msg.from_id,
to_id,
timestamp,
msg.timestamp_sort,
msg.viewtype,
msg.state,
msg.text,