mirror of
https://github.com/chatmail/core.git
synced 2026-05-21 15:56:30 +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 mail_raw;
|
||||||
let mut gossipped_addr = Default::default();
|
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)) => {
|
Ok((raw, signatures)) => {
|
||||||
if let Some(raw) = raw {
|
if let Some(raw) = raw {
|
||||||
// Encrypted, but maybe unsigned message. Only if
|
// Encrypted, but maybe unsigned message. Only if
|
||||||
@@ -147,8 +148,12 @@ impl MimeMessage {
|
|||||||
if !signatures.is_empty() {
|
if !signatures.is_empty() {
|
||||||
let gossip_headers =
|
let gossip_headers =
|
||||||
decrypted_mail.headers.get_all_values("Autocrypt-Gossip");
|
decrypted_mail.headers.get_all_values("Autocrypt-Gossip");
|
||||||
gossipped_addr =
|
gossipped_addr = update_gossip_peerstates(
|
||||||
update_gossip_peerstates(context, message_time, &mail, gossip_headers)
|
context,
|
||||||
|
message_time,
|
||||||
|
&mail,
|
||||||
|
gossip_headers,
|
||||||
|
)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,10 +177,10 @@ impl MimeMessage {
|
|||||||
&decrypted_mail.headers,
|
&decrypted_mail.headers,
|
||||||
);
|
);
|
||||||
|
|
||||||
(decrypted_mail, signatures)
|
(decrypted_mail, signatures, true)
|
||||||
} else {
|
} else {
|
||||||
// Message was not encrypted
|
// Message was not encrypted
|
||||||
(mail, signatures)
|
(mail, signatures, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
@@ -187,7 +192,7 @@ impl MimeMessage {
|
|||||||
// and the caller cannot display the message
|
// and the caller cannot display the message
|
||||||
// and try to assign the message to a chat
|
// and try to assign the message to a chat
|
||||||
warn!(context, "decryption failed: {}", err);
|
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.heuristically_parse_ndn(context).await;
|
||||||
parser.parse_headers(context)?;
|
parser.parse_headers(context)?;
|
||||||
|
|
||||||
if parser.signatures.is_empty() {
|
if warn_empty_signature && parser.signatures.is_empty() {
|
||||||
for part in parser.parts.iter_mut() {
|
for part in parser.parts.iter_mut() {
|
||||||
part.error = "No valid signature".to_string();
|
part.error = "No valid signature".to_string();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user