diff options
-rw-r--r-- | service/pixelated/adapter/mail.py | 11 | ||||
-rw-r--r-- | service/pixelated/controllers/features_controller.py | 2 | ||||
-rw-r--r-- | service/test/unit/adapter/mail_test.py | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/service/pixelated/adapter/mail.py b/service/pixelated/adapter/mail.py index 124a16b1..eedc8242 100644 --- a/service/pixelated/adapter/mail.py +++ b/service/pixelated/adapter/mail.py @@ -243,9 +243,13 @@ class PixelatedMail(Mail): @property def security_casing(self): - casing = {"imprints": []} + casing = {"imprints": [], "locks": []} if self.signed: casing["imprints"].append({"state": "valid", "seal": {"validity": "valid"}}) + + if self.encrypted: + casing["locks"].append({"state": "valid"}) + return casing @property @@ -312,5 +316,6 @@ class PixelatedMail(Mail): def signed(self): return self.hdoc.content["headers"].get("X-Leap-Signature", "").startswith("valid") - def encrypt(self): - pass + @property + def encrypted(self): + return self.hdoc.content["headers"].get("OpenPGP", None) is not None diff --git a/service/pixelated/controllers/features_controller.py b/service/pixelated/controllers/features_controller.py index b91aa183..9720b7f2 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', 'encryptionStatus'] + DISABLED_FEATURES = ['draftReply'] def __init__(self): pass diff --git a/service/test/unit/adapter/mail_test.py b/service/test/unit/adapter/mail_test.py index adc17e44..4ce398b8 100644 --- a/service/test/unit/adapter/mail_test.py +++ b/service/test/unit/adapter/mail_test.py @@ -85,7 +85,7 @@ class TestPixelatedMail(unittest.TestCase): }, 'ident': 'chash', 'mailbox': 'inbox', - 'security_casing': {'imprints': []}, + 'security_casing': {'imprints': [], 'locks': []}, 'status': ['recent'], 'tags': [], 'attachments': [] |