Resultification

This commit is contained in:
link2xt
2021-09-04 18:51:59 +00:00
parent 3c43d790a3
commit 5f065b245f
17 changed files with 180 additions and 184 deletions

View File

@@ -1109,15 +1109,19 @@ impl Contact {
.unwrap_or_default()
}
pub async fn scaleup_origin_by_id(context: &Context, contact_id: u32, origin: Origin) -> bool {
pub async fn scaleup_origin_by_id(
context: &Context,
contact_id: u32,
origin: Origin,
) -> Result<()> {
context
.sql
.execute(
"UPDATE contacts SET origin=? WHERE id=? AND origin<?;",
paramsv![origin, contact_id as i32, origin],
)
.await
.is_ok()
.await?;
Ok(())
}
}