diff options
Diffstat (limited to 'service/pixelated/adapter/mailstore')
-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 |