From ab17e8b29b6f94c5ffa55577a7c7c46dedcef24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 19 Aug 2013 15:44:04 -0300 Subject: Improve the unseen filter --- src/leap/mail/imap/server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/leap') 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): """ -- cgit v1.2.3