change api interface

This commit is contained in:
Sebastian Klähn
2022-09-18 12:28:01 +02:00
committed by Septias
parent 81415ce20e
commit e9f77ff753
3 changed files with 13 additions and 15 deletions

View File

@@ -3303,24 +3303,22 @@ pub unsafe extern "C" fn dc_msg_get_webxdc_info(msg: *mut dc_msg_t) -> *mut libc
}
#[no_mangle]
pub unsafe extern "C" fn dc_get_updating_webxdc(
pub unsafe extern "C" fn dc_is_webxdc_updating(
context: *mut dc_context_t,
) -> *mut dc_array::dc_array_t {
msg_id: u32,
) -> libc::c_int {
if context.is_null() {
eprintln!("ignoring careless call to dc_get_blocked_contacts()");
return ptr::null_mut();
return 0;
}
let ctx = &*context;
let arr: Vec<MsgId> = block_on(async move {
block_on(async move {
webxdc::get_busy_webxdc_instances(ctx)
.await
.unwrap_or_default()
.into_iter()
.collect()
});
Box::into_raw(Box::new(dc_array_t::from(arr)))
.contains(&MsgId::new(msg_id)) as libc::c_int
})
}
#[no_mangle]