Skip to content

Commit 4169e0c

Browse files
committed
api!: remove deprecated is_protection_broken
1 parent ef5fbd9 commit 4169e0c

File tree

6 files changed

+1
-45
lines changed

6 files changed

+1
-45
lines changed

deltachat-ffi/deltachat.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,28 +3859,6 @@ int dc_chat_is_protected (const dc_chat_t* chat);
38593859
int dc_chat_is_encrypted (const dc_chat_t *chat);
38603860

38613861

3862-
/**
3863-
* Checks if the chat was protected, and then an incoming message broke this protection.
3864-
*
3865-
* This function is only useful if the UI enabled the `verified_one_on_one_chats` feature flag,
3866-
* otherwise it will return false for all chats.
3867-
*
3868-
* 1:1 chats are automatically set as protected when a contact is verified.
3869-
* When a message comes in that is not encrypted / signed correctly,
3870-
* the chat is automatically set as unprotected again.
3871-
* dc_chat_is_protection_broken() will return true until dc_accept_chat() is called.
3872-
*
3873-
* The UI should let the user confirm that this is OK with a message like
3874-
* `Bob sent a message from another device. Tap to learn more` and then call dc_accept_chat().
3875-
*
3876-
* @deprecated 2025-07 chats protection cannot break any longer
3877-
* @memberof dc_chat_t
3878-
* @param chat The chat object.
3879-
* @return 1=chat protection broken, 0=otherwise.
3880-
*/
3881-
int dc_chat_is_protection_broken (const dc_chat_t* chat);
3882-
3883-
38843862
/**
38853863
* Check if locations are sent to the chat
38863864
* at the time the object was created using dc_get_chat().

deltachat-ffi/src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3165,16 +3165,6 @@ pub unsafe extern "C" fn dc_chat_is_encrypted(chat: *mut dc_chat_t) -> libc::c_i
31653165
.unwrap_or_log_default(&ffi_chat.context, "Failed dc_chat_is_encrypted") as libc::c_int
31663166
}
31673167

3168-
#[no_mangle]
3169-
pub unsafe extern "C" fn dc_chat_is_protection_broken(chat: *mut dc_chat_t) -> libc::c_int {
3170-
if chat.is_null() {
3171-
eprintln!("ignoring careless call to dc_chat_is_protection_broken()");
3172-
return 0;
3173-
}
3174-
let ffi_chat = &*chat;
3175-
ffi_chat.chat.is_protection_broken() as libc::c_int
3176-
}
3177-
31783168
#[no_mangle]
31793169
pub unsafe extern "C" fn dc_chat_is_sending_locations(chat: *mut dc_chat_t) -> libc::c_int {
31803170
if chat.is_null() {

deltachat-jsonrpc/src/api/types/chat.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ pub struct FullChat {
7171
fresh_message_counter: usize,
7272
// is_group - please check over chat.type in frontend instead
7373
is_contact_request: bool,
74-
/// Deprecated 2025-07. Chats protection cannot break any longer.
75-
is_protection_broken: bool,
7674

7775
is_device_chat: bool,
7876
self_in_group: bool,
@@ -147,7 +145,6 @@ impl FullChat {
147145
color,
148146
fresh_message_counter,
149147
is_contact_request: chat.is_contact_request(),
150-
is_protection_broken: chat.is_protection_broken(),
151148
is_device_chat: chat.is_device_talk(),
152149
self_in_group: contact_ids.contains(&ContactId::SELF),
153150
is_muted: chat.is_muted(),
@@ -218,8 +215,6 @@ pub struct BasicChat {
218215
is_self_talk: bool,
219216
color: String,
220217
is_contact_request: bool,
221-
/// Deprecated 2025-07. Chats protection cannot break any longer.
222-
is_protection_broken: bool,
223218

224219
is_device_chat: bool,
225220
is_muted: bool,
@@ -249,7 +244,6 @@ impl BasicChat {
249244
is_self_talk: chat.is_self_talk(),
250245
color,
251246
is_contact_request: chat.is_contact_request(),
252-
is_protection_broken: chat.is_protection_broken(),
253247
is_device_chat: chat.is_device_talk(),
254248
is_muted: chat.is_muted(),
255249
})

src/chat.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,11 +1917,6 @@ impl Chat {
19171917
Ok(is_encrypted)
19181918
}
19191919

1920-
/// Deprecated 2025-07. Returns false.
1921-
pub fn is_protection_broken(&self) -> bool {
1922-
false
1923-
}
1924-
19251920
/// Returns true if location streaming is enabled in the chat.
19261921
pub fn is_sending_locations(&self) -> bool {
19271922
self.is_sending_locations

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ pub enum Config {
422422
/// Regardless of this setting, `chat.is_protected()` returns true while the key is verified,
423423
/// and when the key changes, an info message is posted into the chat.
424424
/// 0=Nothing else happens when the key changes.
425-
/// 1=After the key changed, `can_send()` returns false and `is_protection_broken()` returns true
425+
/// 1=After the key changed, `can_send()` returns false
426426
/// until `chat_id.accept()` is called.
427427
#[strum(props(default = "0"))]
428428
VerifiedOneOnOneChats,

src/tests/verified_chats.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,6 @@ async fn assert_verified(this: &TestContext, other: &TestContext, protected: Pro
919919
chat.is_protected(),
920920
protected == ProtectionStatus::Protected
921921
);
922-
assert_eq!(chat.is_protection_broken(), false);
923922
}
924923

925924
async fn enable_verified_oneonone_chats(test_contexts: &[&TestContext]) {

0 commit comments

Comments
 (0)