summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/mail_service.py
diff options
context:
space:
mode:
authorPatrick Maia and Victor Shyba <pixelated-team+pmaia+vshyba@thoughtworks.com>2014-09-05 22:45:55 +0000
committerPatrick Maia <pmaia@thoughtworks.com>2014-09-05 22:46:17 +0000
commit3c79a54ab332e15f31a4a57a4a9baabf4b62e26a (patch)
treece6b592049227da18b0500f4695b0feb490a944d /service/pixelated/adapter/mail_service.py
parentd2cf8b51904420917a5f86986ce7c02e89935998 (diff)
#51 - persists new tags globally (in a local file) and shows on tag list
Diffstat (limited to 'service/pixelated/adapter/mail_service.py')
-rw-r--r--service/pixelated/adapter/mail_service.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/mail_service.py
index e3444b9f..2c67ae2d 100644
--- a/service/pixelated/adapter/mail_service.py
+++ b/service/pixelated/adapter/mail_service.py
@@ -14,8 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
-from pixelated.adapter.tag import Tag
-
class MailService:
__slots__ = ['leap_session', 'account', 'mailbox_name']
@@ -41,13 +39,9 @@ class MailService:
def update_tags(self, mail_id, new_tags):
mail = self.mail(mail_id)
- tags = set(Tag(str_tag) for str_tag in new_tags)
- current_tags = mail.update_tags(tags)
- self._update_mailbox_tags(tags)
- return current_tags
-
- def _update_mailbox_tags(self, tags):
- self.mailbox.update_tags(tags)
+ added, removed = mail.update_tags(new_tags)
+ self.mailbox.notify_tags_updated(added, removed, self.ident)
+ return new_tags
def mail(self, mail_id):
return self.mailbox.mail(mail_id)