From d6a6560f0ecd4d434f6fe5e1dd5f7bf40fcb2430 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sun, 22 Mar 2015 00:55:56 -0300 Subject: 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 --- service/pixelated/adapter/services/mailbox.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'service/pixelated/adapter/services') 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) -- cgit v1.2.3