mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
feat: Move unverified messages which don't introduce a new Autocrypt key from protected 1:1 chats to ad-hoc groups
This prevents protected 1:1 chats from breaking by messages sent by classical MUAs. TODO: Some `tests::verified_chats` tests are failing, but as far as i see from the log, the tests must be fixed, the change itself looks ok. Not fixing the tests now, not sure we will merge this as it's just POC.
This commit is contained in:
@@ -769,12 +769,12 @@ async fn add_parts(
|
||||
new_protection =
|
||||
match decryption_info.autocrypt_header.as_ref().filter(|ah| {
|
||||
Some(&ah.public_key.fingerprint())
|
||||
== decryption_info
|
||||
!= decryption_info
|
||||
.peerstate
|
||||
.as_ref()
|
||||
.and_then(|p| p.verified_key_fingerprint.as_ref())
|
||||
}) {
|
||||
Some(_) => {
|
||||
None => {
|
||||
if let Some(new_chat_id) = create_adhoc_group(
|
||||
context,
|
||||
mime_parser,
|
||||
@@ -801,7 +801,7 @@ async fn add_parts(
|
||||
}
|
||||
chat.protected
|
||||
}
|
||||
None => ProtectionStatus::ProtectionBroken,
|
||||
Some(_) => ProtectionStatus::ProtectionBroken,
|
||||
};
|
||||
}
|
||||
if chat.protected != new_protection {
|
||||
|
||||
Reference in New Issue
Block a user