diff options
author | Neissi Torres Lima <neissi.lima@gmail.com> | 2014-11-24 18:54:05 -0200 |
---|---|---|
committer | Neissi Torres Lima <neissi.lima@gmail.com> | 2014-11-24 18:54:47 -0200 |
commit | ed857631616052bc137c6b1d50368bfbf711210d (patch) | |
tree | 5faaf6d1ec43e84a759bb4f0d2ef092e1298958b /service/pixelated | |
parent | ced2b82f8e6d5e7759d7669b2083f30e59637ecc (diff) |
#59 Bruno/Neissi - adding signature status
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/mail.py | 14 | ||||
-rw-r--r-- | service/pixelated/controllers/features_controller.py | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/service/pixelated/adapter/mail.py b/service/pixelated/adapter/mail.py index fc32366a..124a16b1 100644 --- a/service/pixelated/adapter/mail.py +++ b/service/pixelated/adapter/mail.py @@ -79,7 +79,7 @@ class Mail: 'ident': self.ident, 'tags': list(self.tags), 'status': list(self.status), - 'security_casing': {}, + 'security_casing': self.security_casing, 'body': self.body, 'mailbox': self.mailbox_name.lower(), 'attachments': self.parts['attachments'] if self.parts else [] @@ -243,7 +243,10 @@ class PixelatedMail(Mail): @property def security_casing(self): - return {} + casing = {"imprints": []} + if self.signed: + casing["imprints"].append({"state": "valid", "seal": {"validity": "valid"}}) + return casing @property def tags(self): @@ -304,3 +307,10 @@ class PixelatedMail(Mail): def has_tag(self, tag): return tag in self.tags + + @property + def signed(self): + return self.hdoc.content["headers"].get("X-Leap-Signature", "").startswith("valid") + + def encrypt(self): + pass diff --git a/service/pixelated/controllers/features_controller.py b/service/pixelated/controllers/features_controller.py index f3fa9dff..b91aa183 100644 --- a/service/pixelated/controllers/features_controller.py +++ b/service/pixelated/controllers/features_controller.py @@ -19,7 +19,7 @@ import os class FeaturesController: - DISABLED_FEATURES = ['draftReply', 'signatureStatus', 'encryptionStatus'] + DISABLED_FEATURES = ['draftReply', 'encryptionStatus'] def __init__(self): pass |