From 74ca3ef54cd013ced72948bc7fef4fddf0ea53bb Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Tue, 24 Jan 2017 18:05:08 -0200 Subject: Extract method for easy reuse Signed-off-by: Ruben Pollan --- src/leap/bitmask/mail/incoming/service.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/leap/bitmask/mail/incoming/service.py b/src/leap/bitmask/mail/incoming/service.py index 5b7ed846..62e65c83 100644 --- a/src/leap/bitmask/mail/incoming/service.py +++ b/src/leap/bitmask/mail/incoming/service.py @@ -458,6 +458,11 @@ class IncomingMail(Service): signkey.fingerprint) return decrmsg.as_string() + d = self._decrypt_by_content_type(msg, senderAddress, encoding) + d.addCallback(add_leap_header) + return d + + def _decrypt_by_content_type(self, msg, senderAddress, encoding): if msg.get_content_type() == MULTIPART_ENCRYPTED: d = self._decrypt_multipart_encrypted_msg(msg, senderAddress) elif msg.get_content_type() == MULTIPART_SIGNED: @@ -465,7 +470,7 @@ class IncomingMail(Service): else: d = self._maybe_decrypt_inline_encrypted_msg( msg, encoding, senderAddress) - d.addCallback(add_leap_header) + d.addErrback(self._errback) return d def _add_verified_signature_header(self, decrmsg, fingerprint): -- cgit v1.2.3