diff options
author | Kali Kaneko <kali@leap.se> | 2013-08-20 17:45:32 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-08-20 17:45:32 +0200 |
commit | 48c151fb66621ebf6557603ab87ea7cde2312de1 (patch) | |
tree | 07562b7bab84bfa4f43fa7ede417419aacdb81a2 /src/leap/mail/imap/server.py | |
parent | eb5e965274aa5a7b84821f45d7bfeca318f994f6 (diff) | |
parent | 4f088e9222e01247abc6a7b43fb41d63d4203e6b (diff) |
Merge remote-tracking branch 'chiiph/bug/various_fixes' into develop
Diffstat (limited to 'src/leap/mail/imap/server.py')
-rw-r--r-- | src/leap/mail/imap/server.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py index 51df86e..7890a76 100644 --- a/src/leap/mail/imap/server.py +++ b/src/leap/mail/imap/server.py @@ -38,6 +38,8 @@ from twisted.python import log from leap.common.check import leap_assert, leap_assert_type from leap.soledad import Soledad from leap.soledad.sqlcipher import SQLCipherDatabase +from leap.common.events import signal +from leap.common.events import events_pb2 as proto logger = logging.getLogger(__name__) @@ -162,6 +164,7 @@ class SoledadBackedAccount(WithMsgFields, IndexedDB): TYPE_SUBS_IDX = 'by-type-and-subscribed' TYPE_MBOX_SEEN_IDX = 'by-type-and-mbox-and-seen' TYPE_MBOX_RECT_IDX = 'by-type-and-mbox-and-recent' + TYPE_MBOX_RECT_SEEN_IDX = 'by-type-and-mbox-and-recent-and-seen' KTYPE = WithMsgFields.TYPE_KEY MBOX_VAL = WithMsgFields.TYPE_MBOX_VAL @@ -178,6 +181,7 @@ class SoledadBackedAccount(WithMsgFields, IndexedDB): # messages TYPE_MBOX_SEEN_IDX: [KTYPE, MBOX_VAL, 'bool(seen)'], TYPE_MBOX_RECT_IDX: [KTYPE, MBOX_VAL, 'bool(recent)'], + TYPE_MBOX_RECT_SEEN_IDX: [KTYPE, MBOX_VAL, 'bool(recent)', 'bool(seen)'], } INBOX_NAME = "INBOX" @@ -989,8 +993,8 @@ class MessageCollection(WithMsgFields, IndexedDB): """ return (doc for doc in self._soledad.get_from_index( - SoledadBackedAccount.TYPE_MBOX_RECT_IDX, - self.TYPE_MESSAGE_VAL, self.mbox, '1')) + SoledadBackedAccount.TYPE_MBOX_RECT_SEEN_IDX, + self.TYPE_MESSAGE_VAL, self.mbox, '1', '0')) def get_unseen(self): """ |