summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorNeissi Torres Lima <neissi.lima@gmail.com>2014-11-26 19:38:08 -0200
committerNeissi Torres Lima <neissi.lima@gmail.com>2014-11-26 19:38:08 -0200
commit6d14c2661d5072516255c7a6e49a4888eb6b3bbd (patch)
tree000052b05a4611478c57a92d04cca724c157bdbf /service/pixelated
parent939d9eca745973a4f1a8c41bcc2be9f8dbf23a58 (diff)
#59 - Adding encryption status
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/mail.py11
-rw-r--r--service/pixelated/controllers/features_controller.py2
2 files changed, 9 insertions, 4 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