mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
add ffi function
This commit is contained in:
@@ -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);
|
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.
|
* Save a draft for a chat in the database.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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<MsgId> = 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]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn dc_msg_get_filemime(msg: *mut dc_msg_t) -> *mut libc::c_char {
|
pub unsafe extern "C" fn dc_msg_get_filemime(msg: *mut dc_msg_t) -> *mut libc::c_char {
|
||||||
if msg.is_null() {
|
if msg.is_null() {
|
||||||
|
|||||||
Reference in New Issue
Block a user