summaryrefslogtreecommitdiff
path: root/service/app/adapter/mail_service.py
diff options
context:
space:
mode:
authorBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-08-14 14:02:49 -0300
committerBruno Wagner Goncalves <bwagner@thoughtworks.com>2014-08-14 14:02:49 -0300
commitff6aafebcc40d3b734da794e732a0b1cd3526964 (patch)
treeabb750b4da9c340fdf2868203f5f9d46ca5c7d08 /service/app/adapter/mail_service.py
parentb5e0973245c2af1c5c9d67f5f15eeb00a93cfc93 (diff)
Update mail tags are now on the right place
Diffstat (limited to 'service/app/adapter/mail_service.py')
-rw-r--r--service/app/adapter/mail_service.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/service/app/adapter/mail_service.py b/service/app/adapter/mail_service.py
index 94612d82..73baef56 100644
--- a/service/app/adapter/mail_service.py
+++ b/service/app/adapter/mail_service.py
@@ -54,17 +54,9 @@ class MailService:
def mails(self, query):
return self.mailbox.messages or []
- def update_mail(self, dict_mail):
- # Iterating over messages because messages.getUID() is not trustworthy
- mail = None
- for message in self.mailbox.messages:
- if message.getUID() == dict_mail['ident']:
- mail = PixelatedMail(message)
-
- new_tags = mail.update_tags(dict_mail['tags'])
-
+ def update_tags(self, mail, new_tags):
+ new_tags = mail.update_tags(new_tags)
self._update_tag_list(new_tags)
-
return mail
def _update_tag_list(self, tags):