diff options
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/pixelated_mail.py | 4 | ||||
-rw-r--r-- | service/pixelated/adapter/pixelated_mailbox.py | 3 | ||||
-rw-r--r-- | service/pixelated/adapter/pixelated_mailboxes.py | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/service/pixelated/adapter/pixelated_mail.py b/service/pixelated/adapter/pixelated_mail.py index 29dbdaa3..4ec9a7cd 100644 --- a/service/pixelated/adapter/pixelated_mail.py +++ b/service/pixelated/adapter/pixelated_mail.py @@ -96,6 +96,10 @@ class PixelatedMail: return set(tags) return set(json.loads(tags)) + def mark_as_deleted(self): + self.remove_all_tags() + self.leap_mail.setFlags((Status.PixelatedStatus.DELETED,), 1) + def remove_all_tags(self): self.update_tags(set([])) diff --git a/service/pixelated/adapter/pixelated_mailbox.py b/service/pixelated/adapter/pixelated_mailbox.py index fc28c733..4d558ea3 100644 --- a/service/pixelated/adapter/pixelated_mailbox.py +++ b/service/pixelated/adapter/pixelated_mailbox.py @@ -71,7 +71,8 @@ class PixelatedMailbox: return self.leap_mailbox.messages.add_msg(raw) def remove(self, mail): - mail.leap_mail.setFlags((Status.PixelatedStatus.DELETED,), 1) + mail.mark_as_deleted() + self.leap_mailbox.expunge() @classmethod diff --git a/service/pixelated/adapter/pixelated_mailboxes.py b/service/pixelated/adapter/pixelated_mailboxes.py index 850db9d9..ad88d438 100644 --- a/service/pixelated/adapter/pixelated_mailboxes.py +++ b/service/pixelated/adapter/pixelated_mailboxes.py @@ -43,7 +43,6 @@ class PixelatedMailBoxes(): return new_mail def move_to_trash(self, mail): - mail.remove_all_tags() origin_mailbox = mail.mailbox_name new_mail_id = self.trash().add(mail) |