diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index b45bfcc4e..bef02bd5c 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -1082,6 +1082,16 @@ int dc_send_webxdc_status_update (dc_context_t* context, uint32_t msg_id, const */ char* dc_get_webxdc_status_updates (dc_context_t* context, uint32_t msg_id, uint32_t serial); + +/** + * List all webxdc that have updates in the queue + * + * @return An array containing all the msg ids + * + */ +dc_array_t* dc_get_updating_webxdc (); + + /** * Save a draft for a chat in the database. * diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 6891bea5f..9e5c04ce9 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -3302,6 +3302,27 @@ 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( + context: *mut dc_context_t, +) -> *mut dc_array::dc_array_t { + if context.is_null() { + eprintln!("ignoring careless call to dc_get_blocked_contacts()"); + return ptr::null_mut(); + } + let ctx = &*context; + + let arr: Vec = 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))) +} + #[no_mangle] pub unsafe extern "C" fn dc_msg_get_filemime(msg: *mut dc_msg_t) -> *mut libc::c_char { if msg.is_null() {