summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-08-19 15:44:04 -0300
committerTomás Touceda <chiiph@leap.se>2013-08-19 15:44:04 -0300
commite08147a053cc3cc3d97938c27c192db19804b3f1 (patch)
treefeb4b2544177930c03e231c3feb8afce46552a81
parentb640d0acdaba29342b2a0f64bff46dc04972f288 (diff)
Improve the unseen filter
-rw-r--r--mail/src/leap/mail/imap/server.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mail/src/leap/mail/imap/server.py b/mail/src/leap/mail/imap/server.py
index 4fd5520..7890a76 100644
--- a/mail/src/leap/mail/imap/server.py
+++ b/mail/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):
"""