From 4685e3d8e6188951a897c25a4772ef227eb27683 Mon Sep 17 00:00:00 2001 From: Patrick Maia and Victor Shyba Date: Fri, 22 Aug 2014 17:12:56 +0000 Subject: fixes bug in which inbox special tag was being duplicated --- service/pixelated/adapter/mail_service.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'service/pixelated/adapter/mail_service.py') diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/mail_service.py index 6498a2e7..fc8002a1 100644 --- a/service/pixelated/adapter/mail_service.py +++ b/service/pixelated/adapter/mail_service.py @@ -30,7 +30,11 @@ class MailService: self.provider = LeapProvider(self.server_name, self.leap_config) self.leap_session = LeapSessionFactory(self.provider).create(LeapCredentials(self.username, self.password)) self.account = self.leap_session.account - self.mailbox = self.account.getMailbox(self.mailbox_name) + + @property + def mailbox(self): + return self.account.getMailbox(self.mailbox_name) + def mails(self, query): mails = self.mailbox.messages or [] @@ -49,7 +53,7 @@ class MailService: self.tags.add(tag) def _update_flags(self, new_tags, mail_id): - new_tags_flag_name = ['tag_' + tag.name for tag in new_tags] + new_tags_flag_name = ['tag_' + tag.name for tag in new_tags if tag.name not in Tags.SPECIAL_TAGS] self.set_flags(mail_id, new_tags_flag_name) def set_flags(self, mail_id, new_tags_flag_name): -- cgit v1.2.3