api: make dc_chat_is_protected always return 0

This commit is contained in:
link2xt
2025-09-09 05:16:53 +00:00
parent 1a808473c1
commit 9316dd3881
2 changed files with 5 additions and 16 deletions

View File

@@ -3890,18 +3890,12 @@ int dc_chat_can_send (const dc_chat_t* chat);
/** /**
* Check if a chat is protected. * Deprecated, always returns 0.
*
* Only verified contacts
* as determined by dc_contact_is_verified()
* can be added to protected chats.
*
* Protected chats are created using dc_create_group_chat()
* by setting the 'protect' parameter to 1.
* *
* @memberof dc_chat_t * @memberof dc_chat_t
* @param chat The chat object. * @param chat The chat object.
* @return 1=chat protected, 0=chat is not protected. * @return Always 0.
* @deprecated 2025-09-09
*/ */
int dc_chat_is_protected (const dc_chat_t* chat); int dc_chat_is_protected (const dc_chat_t* chat);

View File

@@ -3206,13 +3206,8 @@ pub unsafe extern "C" fn dc_chat_can_send(chat: *mut dc_chat_t) -> libc::c_int {
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn dc_chat_is_protected(chat: *mut dc_chat_t) -> libc::c_int { pub extern "C" fn dc_chat_is_protected(_chat: *mut dc_chat_t) -> libc::c_int {
if chat.is_null() { 0
eprintln!("ignoring careless call to dc_chat_is_protected()");
return 0;
}
let ffi_chat = &*chat;
ffi_chat.chat.is_protected() as libc::c_int
} }
#[no_mangle] #[no_mangle]