Compare commits

...

1 Commits

Author SHA1 Message Date
B. Petersen
c63fbf199a display failed messages 2019-11-02 00:34:14 +01:00
2 changed files with 20 additions and 7 deletions

View File

@@ -117,11 +117,24 @@ impl<'a> MimeParser<'a> {
);
if r == MAILIMF_NO_ERROR as libc::c_int && !self.mimeroot.is_null() {
let (encrypted, signatures, gossipped_addr) =
e2ee::try_decrypt(self.context, self.mimeroot)?;
self.encrypted = encrypted;
self.signatures = signatures;
self.gossipped_addr = gossipped_addr;
match e2ee::try_decrypt(self.context, self.mimeroot) {
Ok((encrypted, signatures, gossipped_addr)) => {
self.encrypted = encrypted;
self.signatures = signatures;
self.gossipped_addr = gossipped_addr;
}
Err(err) => {
// continue with the current, still encrypted, mime tree.
// unencrypted parts will be replaced by an error message
// that is added as "the message" to the chat then.
//
// if we just return here, the header is missing
// and the caller cannot display the message
// and try to assign the message to a chat
warn!(self.context, "decryption failed: {}", err);
}
}
self.parse_mime_recursive(self.mimeroot);
if let Some(field) = self.lookup_field("Subject") {

View File

@@ -65,12 +65,12 @@ pub unsafe fn dc_receive_imf(
let mut mime_parser = MimeParser::new(context);
if let Err(err) = mime_parser.parse(imf_raw) {
error!(context, "dc_receive_imf parse error: {}", err);
warn!(context, "dc_receive_imf parse error: {}", err);
};
if mime_parser.header.is_empty() {
// Error - even adding an empty record won't help as we do not know the message ID
info!(context, "No header.");
warn!(context, "No header.");
return;
}