summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/services
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-03-22 00:55:56 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-03-22 01:00:32 -0300
commitd6a6560f0ecd4d434f6fe5e1dd5f7bf40fcb2430 (patch)
treee3d6757ad45c41e1615ae095b69634248ce15ef0 /service/pixelated/adapter/services
parent37781b4dccadb2e10589d814cd748ee6d83de9ab (diff)
checks if a mailbox is fresh (uid is 0).
If so, we are able to put welcome mail on INBOX after checking it -- Issue #334
Diffstat (limited to 'service/pixelated/adapter/services')
-rw-r--r--service/pixelated/adapter/services/mailbox.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/service/pixelated/adapter/services/mailbox.py b/service/pixelated/adapter/services/mailbox.py
index e358abda..a4029d78 100644
--- a/service/pixelated/adapter/services/mailbox.py
+++ b/service/pixelated/adapter/services/mailbox.py
@@ -23,6 +23,10 @@ class Mailbox(object):
self.search_engine = search_engine
self.querier = querier
+ @property
+ def fresh(self):
+ return self.querier.get_lastuid(self.mailbox_name) == 0
+
def mail(self, mail_id):
return self.querier.mail(mail_id)