diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-07-24 12:01:39 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-08-11 17:00:28 +0200 |
commit | cda364d86469f79d52936dbfeb451e9809b66564 (patch) | |
tree | c5a098d8e2044553ff9fd03997124845c901c011 /service/pixelated | |
parent | 0916ac8f9857974dc9ccf5eeda22d03f15a0eba3 (diff) |
Added all_mails to LeapMailStore.
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/mailstore/__init__.py | 3 | ||||
-rw-r--r-- | service/pixelated/adapter/mailstore/leap_mailstore.py | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/service/pixelated/adapter/mailstore/__init__.py b/service/pixelated/adapter/mailstore/__init__.py index 2e7f132a..05d21e8b 100644 --- a/service/pixelated/adapter/mailstore/__init__.py +++ b/service/pixelated/adapter/mailstore/__init__.py @@ -22,6 +22,9 @@ class MailStore(object): def get_mails(self, mail_ids): pass + def all_mails(self): + pass + def delete_mail(self, mail_id): pass diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py index 038163f3..1b72707f 100644 --- a/service/pixelated/adapter/mailstore/leap_mailstore.py +++ b/service/pixelated/adapter/mailstore/leap_mailstore.py @@ -77,6 +77,15 @@ class LeapMailStore(MailStore): pass @defer.inlineCallbacks + def all_mails(self): + mdocs = yield self.soledad.get_from_index('by-type', 'meta') + + mail_ids = map(lambda doc: doc.doc_id, mdocs) + + mails = yield self.get_mails(mail_ids) + defer.returnValue(mails) + + @defer.inlineCallbacks def _leap_message_to_leap_mail(self, mail_id, message, include_body): if include_body: body = (yield message._wrapper.get_body(self.soledad)).raw |