summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/mail_service.py8
-rw-r--r--service/pixelated/tags.py3
2 files changed, 9 insertions, 2 deletions
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):
diff --git a/service/pixelated/tags.py b/service/pixelated/tags.py
index 7452b7d6..cae5987e 100644
--- a/service/pixelated/tags.py
+++ b/service/pixelated/tags.py
@@ -27,6 +27,9 @@ class Tag:
}
}
+ def __repr__(self):
+ return self.name
+
class Tags: