summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/model
diff options
context:
space:
mode:
authorkaeff <hi@kaeff.net>2015-09-04 18:24:38 +0200
committerkaeff <hi@kaeff.net>2015-09-04 18:34:27 +0200
commit5421b5aab20daa59bc378191522db009a557aa68 (patch)
tree7ea0e9e3de4fe1f2a82f06ae4085dfebd7eade76 /service/pixelated/adapter/model
parentd044a34e9b5a0c341581daae03ba40fc72005170 (diff)
Prepare removing SoledadQuerier from Mail
Discovered that Mail#save was still using SoledadQuerier. There were 3 methods using it: - update_tags: Covered by MailService -> moved test & fixed impl - mark_as_read: Already implemented on MailService -> removed - mark_as_unread: Still needs to be moved - remove_all_tags: Unused -> deleted - mark_as_not_recent: Unused -> deleted Issue: #432
Diffstat (limited to 'service/pixelated/adapter/model')
-rw-r--r--service/pixelated/adapter/model/mail.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/service/pixelated/adapter/model/mail.py b/service/pixelated/adapter/model/mail.py
index 733678db..53b86aaf 100644
--- a/service/pixelated/adapter/model/mail.py
+++ b/service/pixelated/adapter/model/mail.py
@@ -436,46 +436,9 @@ class PixelatedMail(Mail):
def flags(self):
return self.fdoc.content['flags']
- def save(self):
- return self.querier.save_mail(self)
-
def set_mailbox(self, mailbox_name):
self.fdoc.content['mbox'] = mailbox_name
- def remove_all_tags(self):
- return self.update_tags(set([]))
-
- @defer.inlineCallbacks
- def update_tags(self, tags):
- yield self._persist_mail_tags(tags)
- defer.returnValue(self.tags)
-
- @defer.inlineCallbacks
- def mark_as_read(self):
- if Status.SEEN in self.flags:
- defer.returnValue(self)
- else:
- self.flags.append(Status.SEEN)
- yield self.save()
- defer.returnValue(self)
-
- @defer.inlineCallbacks
- def mark_as_unread(self):
- if Status.SEEN in self.flags:
- self.flags.remove(Status.SEEN)
- yield self.save()
- defer.returnValue(self)
-
- def mark_as_not_recent(self):
- if Status.RECENT in self.flags:
- self.flags.remove(Status.RECENT)
- self.save()
- return self
-
- def _persist_mail_tags(self, current_tags):
- self.fdoc.content['tags'] = json.dumps(list(current_tags))
- return self.save()
-
def has_tag(self, tag):
return tag in self.tags