summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/messages.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-02-07 02:27:58 -0400
committerKali Kaneko <kali@leap.se>2014-02-17 11:38:21 -0400
commit6586c21a12bfa0d9026068629a9d34203ad577c7 (patch)
tree761be381f0923dd7da47716520cc3bd084669c90 /src/leap/mail/imap/messages.py
parentee0786c57d72aa8b8da76533f33c3dd65253a878 (diff)
change internal storage and keying scheme in memstore
Diffstat (limited to 'src/leap/mail/imap/messages.py')
-rw-r--r--src/leap/mail/imap/messages.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py
index 3fbe2ad..3d25598 100644
--- a/src/leap/mail/imap/messages.py
+++ b/src/leap/mail/imap/messages.py
@@ -1290,10 +1290,7 @@ class MessageCollection(WithMsgFields, IndexedDB, MailParser, MBoxParser):
:rtype: int
"""
- # XXX get this from a public method in memstore
- store = self.memstore._msg_store
- return len([uid for (mbox, uid) in store.keys()
- if mbox == self.mbox])
+ return self.memstore.count(self.mbox)
# unseen messages
@@ -1305,10 +1302,7 @@ class MessageCollection(WithMsgFields, IndexedDB, MailParser, MBoxParser):
:return: iterator through unseen message doc UIDs
:rtype: iterable
"""
- # XXX get this from a public method in memstore
- store = self.memstore._msg_store
- return (uid for (mbox, uid), d in store.items()
- if mbox == self.mbox and "\\Seen" not in d["fdoc"]["flags"])
+ return self.memstore.unseen_iter(self.mbox)
def count_unseen(self):
"""