diff options
author | Kali Kaneko <kali@leap.se> | 2015-01-22 14:02:28 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-02-11 14:05:43 -0400 |
commit | 66adeda5603aa5a1a29f027bfe6a8536c488ac97 (patch) | |
tree | 510d31aeffda5bb560167edea54c8762db339db2 /src/leap/mail/mail.py | |
parent | d586ea252e187e811cd2851522cdfab74428fd75 (diff) |
Fix recent/unseen notifications
Diffstat (limited to 'src/leap/mail/mail.py')
-rw-r--r-- | src/leap/mail/mail.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/leap/mail/mail.py b/src/leap/mail/mail.py index aa499c0..d986f59 100644 --- a/src/leap/mail/mail.py +++ b/src/leap/mail/mail.py @@ -295,6 +295,7 @@ class MessageCollection(object): # server to accept deferreds. # [ ] Use inheritance for the mailbox-collection instead of handling the # special cases everywhere? + # [ ] or maybe a mailbox_only decorator... # Account should provide an adaptor instance when creating this collection. adaptor = None @@ -419,14 +420,24 @@ class MessageCollection(object): return d def count_recent(self): - # FIXME HACK - # TODO ------------------------ implement this - return 3 + """ + Count the recent messages in this collection. + :return: a Deferred that will fire with the integer for the count. + :rtype: Deferred + """ + if not self.is_mailbox_collection(): + raise NotImplementedError() + return self.adaptor.get_count_recent(self.store, self.mbox_uuid) def count_unseen(self): - # FIXME hack - # TODO ------------------------ implement this - return 3 + """ + Count the unseen messages in this collection. + :return: a Deferred that will fire with the integer for the count. + :rtype: Deferred + """ + if not self.is_mailbox_collection(): + raise NotImplementedError() + return self.adaptor.get_count_unseen(self.store, self.mbox_uuid) def get_uid_next(self): """ |