mirror of
https://github.com/chatmail/core.git
synced 2026-05-25 17:56:31 +03:00
fix threading in interation with non-delta-clients
threading was broken in core43 as this flags unencrypted messages as errors and errors are not replied-to. the fix is not to mark missing signatures for unencrypted messages as errors.
This commit is contained in:
@@ -127,7 +127,8 @@ impl MimeMessage {
|
||||
let mail_raw;
|
||||
let mut gossipped_addr = Default::default();
|
||||
|
||||
let (mail, signatures) = match e2ee::try_decrypt(context, &mail, message_time).await {
|
||||
let (mail, signatures, warn_empty_signature) =
|
||||
match e2ee::try_decrypt(context, &mail, message_time).await {
|
||||
Ok((raw, signatures)) => {
|
||||
if let Some(raw) = raw {
|
||||
// Encrypted, but maybe unsigned message. Only if
|
||||
@@ -147,8 +148,12 @@ impl MimeMessage {
|
||||
if !signatures.is_empty() {
|
||||
let gossip_headers =
|
||||
decrypted_mail.headers.get_all_values("Autocrypt-Gossip");
|
||||
gossipped_addr =
|
||||
update_gossip_peerstates(context, message_time, &mail, gossip_headers)
|
||||
gossipped_addr = update_gossip_peerstates(
|
||||
context,
|
||||
message_time,
|
||||
&mail,
|
||||
gossip_headers,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -172,10 +177,10 @@ impl MimeMessage {
|
||||
&decrypted_mail.headers,
|
||||
);
|
||||
|
||||
(decrypted_mail, signatures)
|
||||
(decrypted_mail, signatures, true)
|
||||
} else {
|
||||
// Message was not encrypted
|
||||
(mail, signatures)
|
||||
(mail, signatures, false)
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
@@ -187,7 +192,7 @@ impl MimeMessage {
|
||||
// and the caller cannot display the message
|
||||
// and try to assign the message to a chat
|
||||
warn!(context, "decryption failed: {}", err);
|
||||
(mail, Default::default())
|
||||
(mail, Default::default(), true)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -215,7 +220,7 @@ impl MimeMessage {
|
||||
parser.heuristically_parse_ndn(context).await;
|
||||
parser.parse_headers(context)?;
|
||||
|
||||
if parser.signatures.is_empty() {
|
||||
if warn_empty_signature && parser.signatures.is_empty() {
|
||||
for part in parser.parts.iter_mut() {
|
||||
part.error = "No valid signature".to_string();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user