api!: remove dc_chatlist_get_context()

This API is dangerous because returned pointer
is only valid until the chatlist is freed,
and may accidentally be passed into dc_context_unref().
This commit is contained in:
link2xt
2026-07-31 20:34:10 +00:00
committed by l
parent e1f5858fa3
commit ae02b6dcfc
2 changed files with 0 additions and 22 deletions

View File

@@ -2872,18 +2872,6 @@ pub unsafe extern "C" fn dc_chatlist_get_summary2(
Box::into_raw(Box::new(summary.into()))
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn dc_chatlist_get_context(
chatlist: *mut dc_chatlist_t,
) -> *const dc_context_t {
if chatlist.is_null() {
eprintln!("ignoring careless call to dc_chatlist_get_context()");
return ptr::null_mut();
}
let ffi_list = unsafe { &*chatlist };
ffi_list.context
}
// dc_chat_t
/// FFI struct for [dc_chat_t]