summaryrefslogtreecommitdiff
path: root/mail/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'mail/src/leap')
-rw-r--r--mail/src/leap/mail/adaptors/soledad_indexes.py5
-rw-r--r--mail/src/leap/mail/incoming/service.py16
2 files changed, 6 insertions, 15 deletions
diff --git a/mail/src/leap/mail/adaptors/soledad_indexes.py b/mail/src/leap/mail/adaptors/soledad_indexes.py
index d2f8b71..eec7d28 100644
--- a/mail/src/leap/mail/adaptors/soledad_indexes.py
+++ b/mail/src/leap/mail/adaptors/soledad_indexes.py
@@ -101,9 +101,6 @@ MAIL_INDEXES = {
TYPE_MBOX_DEL_IDX: [TYPE, MBOX_UUID, 'bool(deleted)'],
# incoming queue
- JUST_MAIL_IDX: [INCOMING_KEY,
+ JUST_MAIL_IDX: ["bool(%s)" % (INCOMING_KEY,),
"bool(%s)" % (ERROR_DECRYPTING_KEY,)],
-
- # the backward-compatible index, will be deprecated at 0.7
- JUST_MAIL_COMPAT_IDX: [INCOMING_KEY],
}
diff --git a/mail/src/leap/mail/incoming/service.py b/mail/src/leap/mail/incoming/service.py
index 23aff3d..71edf08 100644
--- a/mail/src/leap/mail/incoming/service.py
+++ b/mail/src/leap/mail/incoming/service.py
@@ -161,21 +161,15 @@ class IncomingMail(Service):
Calls a deferred that will execute the fetch callback
in a separate thread
"""
- def mail_compat(failure):
- if failure.check(u1db_errors.InvalidGlobbing):
- # It looks like we are a dealing with an outdated
- # mx. Fallback to the version of the index
- warnings.warn("JUST_MAIL_COMPAT_IDX will be deprecated!",
- DeprecationWarning)
- return self._soledad.get_from_index(
- fields.JUST_MAIL_COMPAT_IDX, "*")
- return failure
+ def _sync_errback(failure):
+ failure.printTraceback()
def syncSoledadCallback(_):
+ # XXX this should be moved to adaptors
d = self._soledad.get_from_index(
- fields.JUST_MAIL_IDX, "*", "0")
- d.addErrback(mail_compat)
+ fields.JUST_MAIL_IDX, "1", "0")
d.addCallback(self._process_doclist)
+ d.addErrback(_sync_errback)
return d
logger.debug("fetching mail for: %s %s" % (