mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
resultify Contact::get_all_blocked()
This commit is contained in:
@@ -1640,7 +1640,13 @@ pub unsafe extern "C" fn dc_get_blocked_cnt(context: *mut dc_context_t) -> libc:
|
||||
}
|
||||
let ctx = &*context;
|
||||
|
||||
block_on(async move { Contact::get_all_blocked(&ctx).await.len() as libc::c_int })
|
||||
block_on(async move {
|
||||
Contact::get_all_blocked(&ctx)
|
||||
.await
|
||||
.log_err(&ctx, "Can't get blocked count")
|
||||
.unwrap_or_default()
|
||||
.len() as libc::c_int
|
||||
})
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@@ -1655,7 +1661,10 @@ pub unsafe extern "C" fn dc_get_blocked_contacts(
|
||||
|
||||
block_on(async move {
|
||||
Box::into_raw(Box::new(dc_array_t::from(
|
||||
Contact::get_all_blocked(&ctx).await,
|
||||
Contact::get_all_blocked(&ctx)
|
||||
.await
|
||||
.log_err(&ctx, "Can't get blocked contacts")
|
||||
.unwrap_or_default(),
|
||||
)))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user