mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
fix: make create_send_msg_jobs actually return row IDs
.execute() was returning the number of rows, so usually 1. .insert() is returning the row ID. In most cases it does not matter because the result is checked with .is_empty(), but send_msg_sync() actually uses the row IDs.
This commit is contained in:
@@ -3037,21 +3037,21 @@ WHERE id=?
|
||||
)?;
|
||||
let all_recipients = recipients.join(" ");
|
||||
if let Some(pre_msg) = &rendered_pre_msg {
|
||||
let row_id = stmt.execute((
|
||||
let row_id = stmt.insert((
|
||||
&pre_msg.rfc724_mid,
|
||||
&all_recipients,
|
||||
&pre_msg.message,
|
||||
msg.id,
|
||||
))?;
|
||||
row_ids.push(row_id.try_into()?);
|
||||
row_ids.push(row_id);
|
||||
}
|
||||
let row_id = stmt.execute((
|
||||
let row_id = stmt.insert((
|
||||
&rendered_msg.rfc724_mid,
|
||||
&all_recipients,
|
||||
&rendered_msg.message,
|
||||
msg.id,
|
||||
))?;
|
||||
row_ids.push(row_id.try_into()?);
|
||||
row_ids.push(row_id);
|
||||
}
|
||||
Ok(row_ids)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user