diff options
author | drebs <drebs@leap.se> | 2013-12-16 11:20:14 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-12-16 11:20:14 -0200 |
commit | 45f957d559940be343820c1b72674e0bfc2dbd62 (patch) | |
tree | fd34d1c91ae37d1ac06e55de3db52b598696fe7e | |
parent | 6cde754952d6c2abf877c6216c9b4b6675209d3c (diff) |
Use CouchDocument from new backend (#4475).
-rw-r--r-- | changes/VERSION_COMPAT | 1 | ||||
-rw-r--r-- | changes/bug_4475_use-couch-document | 1 | ||||
-rw-r--r-- | src/leap/mx/mail_receiver.py | 13 |
3 files changed, 8 insertions, 7 deletions
diff --git a/changes/VERSION_COMPAT b/changes/VERSION_COMPAT index cc00ecf..615578e 100644 --- a/changes/VERSION_COMPAT +++ b/changes/VERSION_COMPAT @@ -8,3 +8,4 @@ # # BEGIN DEPENDENCY LIST ------------------------- # leap.foo.bar>=x.y.z +leap.soledad.common>=0.5 diff --git a/changes/bug_4475_use-couch-document b/changes/bug_4475_use-couch-document new file mode 100644 index 0000000..54c6897 --- /dev/null +++ b/changes/bug_4475_use-couch-document @@ -0,0 +1 @@ + o Use CouchDocument to comply with new Soledad couch backend (#4475). diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py index c90dda9..7836ab2 100644 --- a/src/leap/mx/mail_receiver.py +++ b/src/leap/mx/mail_receiver.py @@ -39,13 +39,12 @@ from twisted.internet import inotify, defer, task from twisted.python import filepath, log from leap.common.mail import get_email_charset -from leap.soledad.common.document import SoledadDocument from leap.soledad.common.crypto import ( EncryptionSchemes, ENC_JSON_KEY, ENC_SCHEME_KEY, ) -from leap.soledad.common.couch import CouchDatabase +from leap.soledad.common.couch import CouchDatabase, CouchDocument from leap.keymanager import openpgp @@ -109,7 +108,7 @@ class MailReceiver(Service): :return: doc to sync with Soledad or None, None if something went wrong. - :rtype: SoledadDocument + :rtype: CouchDocument """ if pubkey is None or len(pubkey) == 0: log.msg("_encrypt_message: Something went wrong, here's all " @@ -125,7 +124,7 @@ class MailReceiver(Service): result = chardet.detect(message_as_string) encoding = result["encoding"] - doc = SoledadDocument(doc_id=str(pyuuid.uuid4())) + doc = CouchDocument(doc_id=str(pyuuid.uuid4())) # store plain text if pubkey is not available data = {'incoming': True, 'content': message_as_string} @@ -167,14 +166,14 @@ class MailReceiver(Service): def _export_message(self, uuid, doc): """ - Given a UUID and a SoledadDocument, it saves it directly in the + Given a UUID and a CouchDocument, it saves it directly in the couchdb that serves as a backend for Soledad, in a db accessible to the recipient of the mail. :param uuid: the mail owner's uuid :type uuid: str - :param doc: SoledadDocument that represents the email - :type doc: SoledadDocument + :param doc: CouchDocument that represents the email + :type doc: CouchDocument :return: True if it's ok to remove the message, False otherwise |