summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-10-17 16:43:37 -0300
committerTomás Touceda <chiiph@leap.se>2013-10-17 16:59:41 -0300
commite9f27feb82523df1ce6948f0c7b62733c2b6c071 (patch)
treeb65deba4449e7c337eeb91b5b9f6d13527596630
parentd2c25d3b1e2c7e694a2a0dad0d9f75ec4df5c53b (diff)
Only show N unread Emails when N > 0
-rw-r--r--changes/bug_display_new_mail_only1
-rw-r--r--src/leap/bitmask/gui/mail_status.py7
2 files changed, 6 insertions, 2 deletions
diff --git a/changes/bug_display_new_mail_only b/changes/bug_display_new_mail_only
new file mode 100644
index 00000000..218cd16e
--- /dev/null
+++ b/changes/bug_display_new_mail_only
@@ -0,0 +1 @@
+ o Only show N unread Emails when N > 0. Fixes #4098. \ No newline at end of file
diff --git a/src/leap/bitmask/gui/mail_status.py b/src/leap/bitmask/gui/mail_status.py
index 2ac9a332..83533666 100644
--- a/src/leap/bitmask/gui/mail_status.py
+++ b/src/leap/bitmask/gui/mail_status.py
@@ -387,8 +387,11 @@ class MailStatusWidget(QtGui.QWidget):
self._set_mail_status(self.tr("Failed"))
elif req.event == proto.IMAP_UNREAD_MAIL:
if self._smtp_started and self._imap_started:
- self._set_mail_status(self.tr("%s Unread Emails") %
- (req.content), ready=2)
+ if req.content != "0":
+ self._set_mail_status(self.tr("%s Unread Emails") %
+ (req.content,), ready=2)
+ else:
+ self._set_mail_status("", ready=2)
else:
leap_assert(False, # XXX ???
"Don't know how to handle this state: %s"