resultify Contact::get_all_blocked()

This commit is contained in:
B. Petersen
2021-02-23 16:55:42 +01:00
committed by bjoern
parent 01af3b7547
commit 79e72418bb
3 changed files with 16 additions and 7 deletions

View File

@@ -675,8 +675,8 @@ impl Contact {
}
/// Get blocked contacts.
pub async fn get_all_blocked(context: &Context) -> Vec<u32> {
context
pub async fn get_all_blocked(context: &Context) -> Result<Vec<u32>> {
let ret = context
.sql
.query_map(
"SELECT id FROM contacts WHERE id>? AND blocked!=0 ORDER BY LOWER(iif(name='',authname,name)||addr),id;",
@@ -687,8 +687,8 @@ impl Contact {
.map_err(Into::into)
},
)
.await
.unwrap_or_default()
.await?;
Ok(ret)
}
/// Returns a textual summary of the encryption state for the contact.