diff options
author | Tomas Touceda <chiiph@leap.se> | 2013-04-25 15:31:09 -0300 |
---|---|---|
committer | Tomas Touceda <chiiph@leap.se> | 2013-05-07 14:02:12 -0300 |
commit | 9042a0f5d7d6cee5bacf8085328a7a29ae99df11 (patch) | |
tree | 28e333060fc108467679bf6bb9224dec4b2ee9ea /src/leap | |
parent | f6d6ff0862052605a5a3af328daadc0b8ce9e3bb (diff) |
Add incoming tag to unencrypted data too
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/mx/mail_receiver.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py index 20b5f4a..00d93ba 100644 --- a/src/leap/mx/mail_receiver.py +++ b/src/leap/mx/mail_receiver.py @@ -53,9 +53,11 @@ def _encrypt_message(uuid_pubkey, address_message): doc = LeapDocument(encryption_scheme=EncryptionSchemes.PUBKEY, doc_id=str(pyuuid.uuid4())) + data = {'incoming': True, 'content': message} + if pubkey is None or len(pubkey) == 0: doc.content = { - "_unencrypted_json": message + "_unencrypted_json": json.dumps(data) } return uuid, doc @@ -65,8 +67,6 @@ def _encrypt_message(uuid_pubkey, address_message): openpgp_key = openpgp._safe_call(_ascii_to_openpgp_cb, pubkey) - data = {'incoming': True, 'content': message} - doc.content = { "_encrypted_json": openpgp.encrypt_asym(json.dumps(data), openpgp_key) } |