summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-09-02 09:11:19 -0300
committerTomás Touceda <chiiph@leap.se>2013-09-02 09:11:19 -0300
commit9a6927faf5d5baf8abf606606681554592a9a4a9 (patch)
tree876c46eff48980c9f1645931b394f1f96d7eeb4c /src/leap/mail/imap
parent9471dd75ddfd7242e08cab927580b97cbf643e0f (diff)
parent39c0bc2671910f46ec565f57ce450438a51bb858 (diff)
Merge remote-tracking branch 'kali/bug/3662_signal_unread_when_flag_changes' into develop
Diffstat (limited to 'src/leap/mail/imap')
-rw-r--r--src/leap/mail/imap/server.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/leap/mail/imap/server.py b/src/leap/mail/imap/server.py
index cfcb3d6..ae76833 100644
--- a/src/leap/mail/imap/server.py
+++ b/src/leap/mail/imap/server.py
@@ -35,6 +35,8 @@ from twisted.python import log
#import u1db
+from leap.common import events as leap_events
+from leap.common.events.events_pb2 import IMAP_UNREAD_MAIL
from leap.common.check import leap_assert, leap_assert_type
from leap.soledad.client import Soledad
@@ -1405,6 +1407,13 @@ class SoledadMailbox(WithMsgFields):
result.append((msg_id, msg))
return tuple(result)
+ def _signal_unread_to_ui(self):
+ """
+ Sends unread event to ui.
+ """
+ leap_events.signal(
+ IMAP_UNREAD_MAIL, str(self.getUnseenCount()))
+
def store(self, messages, flags, mode, uid):
"""
Sets the flags of one or more messages.
@@ -1455,6 +1464,7 @@ class SoledadMailbox(WithMsgFields):
self._update(msg.setFlags(flags))
result[msg_id] = msg.getFlags()
+ self._signal_unread_to_ui()
return result
def close(self):