diff options
| author | Kali Kaneko <kali@leap.se> | 2014-01-29 00:54:20 -0400 | 
|---|---|---|
| committer | Kali Kaneko <kali@leap.se> | 2014-01-30 14:20:56 -0400 | 
| commit | 1b71ba510a2e6680f1ecc84eacfc492b0bbe24fc (patch) | |
| tree | cb0984252737a9e4dfc9df24d8d8e3a6974bf71f /src/leap/mail/imap/mailbox.py | |
| parent | 3243d37fcc3703bc9428717ffc72c4e680831813 (diff) | |
Fix copy and deletion problems
* reorganize and simplify STORE command processing
* add the notification after the processing of the whole sequence
Diffstat (limited to 'src/leap/mail/imap/mailbox.py')
| -rw-r--r-- | src/leap/mail/imap/mailbox.py | 24 | 
1 files changed, 1 insertions, 23 deletions
| diff --git a/src/leap/mail/imap/mailbox.py b/src/leap/mail/imap/mailbox.py index a0eb0a9..3a6937f 100644 --- a/src/leap/mail/imap/mailbox.py +++ b/src/leap/mail/imap/mailbox.py @@ -654,7 +654,6 @@ class SoledadMailbox(WithMsgFields, MBoxParser):          unseen = self.getUnseenCount()          leap_events.signal(IMAP_UNREAD_MAIL, str(unseen)) -    @deferred      def store(self, messages_asked, flags, mode, uid):          """          Sets the flags of one or more messages. @@ -697,28 +696,7 @@ class SoledadMailbox(WithMsgFields, MBoxParser):              log.msg('read only mailbox!')              raise imap4.ReadOnlyMailbox -        result = {} -        for msg_id in seq_messg: -            log.msg("MSG ID = %s" % msg_id) -            msg = self.messages.get_msg_by_uid(msg_id) -            if not msg: -                continue -            # We duplicate the set operations here -            # to return the result because it's less costly than -            # retrieving the flags again. -            newflags = set(msg.getFlags()) - -            if mode == 1: -                msg.addFlags(flags) -                newflags = newflags.union(set(flags)) -            elif mode == -1: -                msg.removeFlags(flags) -                newflags.difference_update(flags) -            elif mode == 0: -                msg.setFlags(flags) -                newflags = set(flags) -            result[msg_id] = newflags -        return result +        return self.messages.set_flags(self.mbox, seq_messg, flags, mode)      # ISearchableMailbox | 
