diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-19 15:44:04 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-19 15:44:04 -0300 |
commit | ab17e8b29b6f94c5ffa55577a7c7c46dedcef24e (patch) | |
tree | 6d508fc6111506ee900578a532ce27c6782a1501 | |
parent | 533512176313e5188df86f08954ba3c74f7c1cfb (diff) |
Improve the unseen filter
-rw-r--r-- | src/leap/mail/imap/server.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py index 4fd5520..7890a76 100644 --- a/src/leap/mail/imap/server.py +++ b/src/leap/mail/imap/server.py @@ -164,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 @@ -180,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" @@ -991,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): """ |