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:
link2xt
2026-08-14 11:17:12 +00:00
committed by l
parent 709c56a889
commit 3af45c306a

View File

@@ -3037,21 +3037,21 @@ WHERE id=?
)?; )?;
let all_recipients = recipients.join(" "); let all_recipients = recipients.join(" ");
if let Some(pre_msg) = &rendered_pre_msg { if let Some(pre_msg) = &rendered_pre_msg {
let row_id = stmt.execute(( let row_id = stmt.insert((
&pre_msg.rfc724_mid, &pre_msg.rfc724_mid,
&all_recipients, &all_recipients,
&pre_msg.message, &pre_msg.message,
msg.id, 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, &rendered_msg.rfc724_mid,
&all_recipients, &all_recipients,
&rendered_msg.message, &rendered_msg.message,
msg.id, msg.id,
))?; ))?;
row_ids.push(row_id.try_into()?); row_ids.push(row_id);
} }
Ok(row_ids) Ok(row_ids)
}; };