summaryrefslogtreecommitdiff
path: root/src/leap/mail/mail.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-01-26 23:41:52 -0400
committerKali Kaneko <kali@leap.se>2015-02-11 14:05:44 -0400
commitad113e53d59213a5accc4f71564fd6ad0f73f74f (patch)
treec22bc9dfc375a8a9d23c33caa9f1fe73ba50cbfd /src/leap/mail/mail.py
parent59f7005a05e50700f4d8f1fba4b036318fa246e6 (diff)
save drafts: search by msg-id
Diffstat (limited to 'src/leap/mail/mail.py')
-rw-r--r--src/leap/mail/mail.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/leap/mail/mail.py b/src/leap/mail/mail.py
index d986f59..2766524 100644
--- a/src/leap/mail/mail.py
+++ b/src/leap/mail/mail.py
@@ -460,6 +460,25 @@ class MessageCollection(object):
"""
return self.mbox_indexer.all_uid_iter(self.mbox_uuid)
+ def get_uid_from_msgid(self, msgid):
+ """
+ Return the UID(s) of the matching msg-ids for this mailbox collection.
+ """
+ if not self.is_mailbox_collection():
+ raise NotImplementedError()
+
+ def get_uid(mdoc_id):
+ if not mdoc_id:
+ return None
+ d = self.mbox_indexer.get_uid_from_doc_id(
+ self.mbox_uuid, mdoc_id)
+ return d
+
+ d = self.adaptor.get_mdoc_id_from_msgid(
+ self.store, self.mbox_uuid, msgid)
+ d.addCallback(get_uid)
+ return d
+
# Manipulate messages
def add_msg(self, raw_msg, flags=tuple(), tags=tuple(), date=""):