summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/account.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2015-03-30 22:46:18 +0200
committerRuben Pollan <meskio@sindominio.net>2015-03-30 22:46:18 +0200
commitd64fb189cc7c05272e0558085740efd8df2598dd (patch)
tree7bb82a2ff750c5dd830201a2aa730e29eabf7168 /src/leap/mail/imap/account.py
parent1568761f4fa7a7f8a9b0caec79ed2552b6c73ba7 (diff)
parent8e916eeadfcd76d50b54a2621d789e6a296dcce6 (diff)
Merge branch 'kali/bug/several-mime-fixes' into develop
Diffstat (limited to 'src/leap/mail/imap/account.py')
-rw-r--r--src/leap/mail/imap/account.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/leap/mail/imap/account.py b/src/leap/mail/imap/account.py
index 38df845..ccb4b75 100644
--- a/src/leap/mail/imap/account.py
+++ b/src/leap/mail/imap/account.py
@@ -163,28 +163,17 @@ class IMAPAccount(object):
# FIXME --- return failure instead of AssertionError
# See AccountTestCase...
leap_assert(name, "Need a mailbox name to create a mailbox")
- if creation_ts is None:
- # by default, we pass an int value
- # taken from the current time
- # we make sure to take enough decimals to get a unique
- # mailbox-uidvalidity.
- creation_ts = int(time.time() * 10E2)
def check_it_does_not_exist(mailboxes):
if name in mailboxes:
raise imap4.MailboxCollision, repr(name)
return mailboxes
- def set_mbox_creation_ts(collection):
- d = collection.set_mbox_attr("created", creation_ts)
- d.addCallback(lambda _: collection)
- return d
-
d = self.account.list_all_mailbox_names()
d.addCallback(check_it_does_not_exist)
- d.addCallback(lambda _: self.account.add_mailbox(name))
+ d.addCallback(lambda _: self.account.add_mailbox(
+ name, creation_ts=creation_ts))
d.addCallback(lambda _: self.account.get_collection_by_mailbox(name))
- d.addCallback(set_mbox_creation_ts)
d.addCallback(self._return_mailbox_from_collection)
return d