summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/services
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-08-05 17:49:00 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-08-11 17:00:32 +0200
commitf29447b4fbed2328f976fdfacd554f051e40b8db (patch)
tree8d55342670ebd692974ca61fc0b7b54ecab9b263 /service/pixelated/adapter/services
parentcc84a89c5c4b3d48b0ef8767c40fa34ef542bccf (diff)
Reverted changes to get tests green.
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.py11
2 files changed, 9 insertions, 8 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py
index 708297b9..23cbc5f7 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.mail_store.all_mails()))
+ defer.returnValue((yield self.querier.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.mail_store.get_mails(mail_ids)
+ mails = yield self.querier.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 (yield self.mail_store.get_mail(mail_id)))
+ defer.returnValue(not(not((yield self.querier.get_header_by_chash(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 ce54055a..52c9c212 100644
--- a/service/pixelated/adapter/services/mailboxes.py
+++ b/service/pixelated/adapter/services/mailboxes.py
@@ -78,13 +78,14 @@ class Mailboxes(object):
return self._move_to(mail_id, self.trash)
def move_to_inbox(self, mail_id):
- # return self._move_to(mail_id, self.inbox)
- return self._move_to(mail_id, 'INBOX')
+ return self._move_to(mail_id, self.inbox)
@defer.inlineCallbacks
- def _move_to(self, mail_id, mailbox_name):
- yield self.mail_store.add_mailbox(mailbox_name)
- mail = yield self.mail_store.move_mail_to_mailbox(mail_id, mailbox_name)
+ def _move_to(self, mail_id, mailbox):
+ mailbox = yield mailbox
+ mail = yield self.querier.mail(mail_id)
+ mail.set_mailbox(mailbox.mailbox_name)
+ mail.save()
defer.returnValue(mail)
def mail(self, mail_id):