Skip to content

Commit ec369bc

Browse files
committed
api!: remove deprecated is_protection_broken
1 parent 50ae9b7 commit ec369bc

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
@@ -3956,28 +3956,6 @@ int dc_chat_is_protected (const dc_chat_t* chat);
39563956
int dc_chat_is_encrypted (const dc_chat_t *chat);
39573957

39583958

3959-
/**
3960-
* Checks if the chat was protected, and then an incoming message broke this protection.
3961-
*
3962-
* This function is only useful if the UI enabled the `verified_one_on_one_chats` feature flag,
3963-
* otherwise it will return false for all chats.
3964-
*
3965-
* 1:1 chats are automatically set as protected when a contact is verified.
3966-
* When a message comes in that is not encrypted / signed correctly,
3967-
* the chat is automatically set as unprotected again.
3968-
* dc_chat_is_protection_broken() will return true until dc_accept_chat() is called.
3969-
*
3970-
* The UI should let the user confirm that this is OK with a message like
3971-
* `Bob sent a message from another device. Tap to learn more` and then call dc_accept_chat().
3972-
*
3973-
* @deprecated 2025-07 chats protection cannot break any longer
3974-
* @memberof dc_chat_t
3975-
* @param chat The chat object.
3976-
* @return 1=chat protection broken, 0=otherwise.
3977-
*/
3978-
int dc_chat_is_protection_broken (const dc_chat_t* chat);
3979-
3980-
39813959
/**
39823960
* Check if locations are sent to the chat
39833961
* 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
@@ -3247,16 +3247,6 @@ pub unsafe extern "C" fn dc_chat_is_encrypted(chat: *mut dc_chat_t) -> libc::c_i
32473247
.unwrap_or_log_default(&ffi_chat.context, "Failed dc_chat_is_encrypted") as libc::c_int
32483248
}
32493249

3250-
#[no_mangle]
3251-
pub unsafe extern "C" fn dc_chat_is_protection_broken(chat: *mut dc_chat_t) -> libc::c_int {
3252-
if chat.is_null() {
3253-
eprintln!("ignoring careless call to dc_chat_is_protection_broken()");
3254-
return 0;
3255-
}
3256-
let ffi_chat = &*chat;
3257-
ffi_chat.chat.is_protection_broken() as libc::c_int
3258-
}
3259-
32603250
#[no_mangle]
32613251
pub unsafe extern "C" fn dc_chat_is_sending_locations(chat: *mut dc_chat_t) -> libc::c_int {
32623252
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
@@ -1920,11 +1920,6 @@ impl Chat {
19201920
Ok(is_encrypted)
19211921
}
19221922

1923-
/// Deprecated 2025-07. Returns false.
1924-
pub fn is_protection_broken(&self) -> bool {
1925-
false
1926-
}
1927-
19281923
/// Returns true if location streaming is enabled in the chat.
19291924
pub fn is_sending_locations(&self) -> bool {
19301925
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
@@ -881,7 +881,6 @@ async fn assert_verified(this: &TestContext, other: &TestContext, protected: Pro
881881
chat.is_protected(),
882882
protected == ProtectionStatus::Protected
883883
);
884-
assert_eq!(chat.is_protection_broken(), false);
885884
}
886885

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

0 commit comments

Comments
 (0)