summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/memorystore.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-02-12 12:39:33 -0400
committerKali Kaneko <kali@leap.se>2014-02-17 11:39:49 -0400
commitb520a60d0e48f36dcebe03d19b65839afc460fe9 (patch)
tree46af2a1834cbced9b62c236155857dbe5d5d002f /src/leap/mail/imap/memorystore.py
parent54114126d0b8e16784b67ee972e549e5c152c9d0 (diff)
move mbox-doc handling to soledadstore, and lock it
Diffstat (limited to 'src/leap/mail/imap/memorystore.py')
-rw-r--r--src/leap/mail/imap/memorystore.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/leap/mail/imap/memorystore.py b/src/leap/mail/imap/memorystore.py
index 4aaee75..ba444b0 100644
--- a/src/leap/mail/imap/memorystore.py
+++ b/src/leap/mail/imap/memorystore.py
@@ -293,6 +293,7 @@ class MemoryStore(object):
# a defer that will inmediately have its callback triggered.
self.reactor.callFromThread(observer.callback, uid)
+
def put_message(self, mbox, uid, message, notify_on_disk=True):
"""
Put an existing message.
@@ -1176,8 +1177,43 @@ class MemoryStore(object):
logger.exception(exc)
finally:
self._start_write_loop()
+
observer.callback(all_deleted)
+ # Mailbox documents and attributes
+
+ # This could be also be cached in memstore, but proxying directly
+ # to soledad since it's not too performance-critical.
+
+ def get_mbox_doc(self, mbox):
+ """
+ Return the soledad document for a given mailbox.
+
+ :param mbox: the mailbox
+ :type mbox: str or unicode
+ :rtype: SoledadDocument or None.
+ """
+ return self.permanent_store.get_mbox_document(mbox)
+
+ def get_mbox_closed(self, mbox):
+ """
+ Return the closed attribute for a given mailbox.
+
+ :param mbox: the mailbox
+ :type mbox: str or unicode
+ :rtype: bool
+ """
+ return self.permanent_store.get_mbox_closed(mbox)
+
+ def set_mbox_closed(self, mbox, closed):
+ """
+ Set the closed attribute for a given mailbox.
+
+ :param mbox: the mailbox
+ :type mbox: str or unicode
+ """
+ self.permanent_store.set_mbox_closed(mbox, closed)
+
# Dump-to-disk controls.
@property