summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-09-02 00:25:24 +0200
committerKali Kaneko <kali@leap.se>2013-09-02 00:25:24 +0200
commitcd20f7077e95602777b8c6c2281e723b331ce6e4 (patch)
tree4d993fd1109f81b7b90afaeba7cfa61fcc226286
parent6a5d6a47599959de04c91ea719ec21a81c74f47c (diff)
Signal unread message when msg saved locally.
Closes: #3654
-rw-r--r--mail/changes/bug_3654_signal_unread_when_saved1
-rw-r--r--mail/src/leap/mail/imap/fetch.py11
2 files changed, 10 insertions, 2 deletions
diff --git a/mail/changes/bug_3654_signal_unread_when_saved b/mail/changes/bug_3654_signal_unread_when_saved
new file mode 100644
index 00000000..e8127f5e
--- /dev/null
+++ b/mail/changes/bug_3654_signal_unread_when_saved
@@ -0,0 +1 @@
+ o Signal unread message to UI when message is saved locally. Closes: #3654
diff --git a/mail/src/leap/mail/imap/fetch.py b/mail/src/leap/mail/imap/fetch.py
index 8b29c5e9..e620a584 100644
--- a/mail/src/leap/mail/imap/fetch.py
+++ b/mail/src/leap/mail/imap/fetch.py
@@ -150,6 +150,13 @@ class LeapIncomingMail(object):
doclist = self._soledad.get_from_index("just-mail", "*")
return doclist
+ def _signal_unread_to_ui(self):
+ """
+ Sends unread event to ui.
+ """
+ leap_events.signal(
+ IMAP_UNREAD_MAIL, str(self._inbox.getUnseenCount()))
+
def _signal_fetch_to_ui(self, doclist):
"""
Sends leap events to ui.
@@ -164,8 +171,7 @@ class LeapIncomingMail(object):
log.msg("there are %s mails" % (num_mails,))
leap_events.signal(
IMAP_FETCHED_INCOMING, str(num_mails), str(fetched_ts))
- leap_events.signal(
- IMAP_UNREAD_MAIL, str(self._inbox.getUnseenCount()))
+ self._signal_unread_to_ui()
return doclist
def _sync_soledad_error(self, failure):
@@ -318,3 +324,4 @@ class LeapIncomingMail(object):
self._soledad.delete_doc(doc)
log.msg("deleted doc %s from incoming" % doc_id)
leap_events.signal(IMAP_MSG_DELETED_INCOMING)
+ self._signal_unread_to_ui()