summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/services
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-07-31 17:04:25 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-08-11 17:00:31 +0200
commit38d810d338ce671b6389cd47d665b87798bcd65c (patch)
treecabce0d36989a2645cfafc50a503623a8d0a92ef /service/pixelated/adapter/services
parent77cb8b69610a893becd99286d85633e5317fedd2 (diff)
First steps migrating mail service to new data model.
Diffstat (limited to 'service/pixelated/adapter/services')
-rw-r--r--service/pixelated/adapter/services/mail_service.py6
-rw-r--r--service/pixelated/adapter/services/mailboxes.py3
2 files changed, 5 insertions, 4 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py
index 23cbc5f7..708297b9 100644
--- a/service/pixelated/adapter/services/mail_service.py
+++ b/service/pixelated/adapter/services/mail_service.py
@@ -29,13 +29,13 @@ class MailService(object):
@defer.inlineCallbacks
def all_mails(self):
- defer.returnValue((yield self.querier.all_mails()))
+ defer.returnValue((yield self.mail_store.all_mails()))
@defer.inlineCallbacks
def mails(self, query, window_size, page):
mail_ids, total = self.search_engine.search(query, window_size, page)
- mails = yield self.querier.mails(mail_ids)
+ mails = yield self.mail_store.get_mails(mail_ids)
defer.returnValue((mails, total))
@@ -72,7 +72,7 @@ class MailService(object):
@defer.inlineCallbacks
def mail_exists(self, mail_id):
- defer.returnValue(not(not((yield self.querier.get_header_by_chash(mail_id)))))
+ defer.returnValue(not (yield self.mail_store.get_mail(mail_id)))
@defer.inlineCallbacks
def send_mail(self, content_dict):
diff --git a/service/pixelated/adapter/services/mailboxes.py b/service/pixelated/adapter/services/mailboxes.py
index 80cc74fe..52c9c212 100644
--- a/service/pixelated/adapter/services/mailboxes.py
+++ b/service/pixelated/adapter/services/mailboxes.py
@@ -22,10 +22,11 @@ from twisted.mail.imap4 import MailboxCollision
class Mailboxes(object):
- def __init__(self, account, soledad_querier, search_engine):
+ def __init__(self, account, mail_store, soledad_querier, search_engine):
self.account = account
self.querier = soledad_querier
self.search_engine = search_engine
+ self.mail_store = mail_store
# for mailbox_name in account.mailboxes:
# MailboxIndexerListener.listen(self.account, mailbox_name, soledad_querier)