summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/mail/incoming
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2016-10-10 13:09:10 -0300
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-10 12:36:51 -0400
commita041d186bad1bf40a40c44da46087285aa04ff2d (patch)
tree54f818a0ded867e36c65834d98f47bcfff01e3ff /src/leap/bitmask/mail/incoming
parent245a743d10fb9e22649c1ef2320cbe1aaac2c63d (diff)
[feat] improve mail service log messages
Diffstat (limited to 'src/leap/bitmask/mail/incoming')
-rw-r--r--src/leap/bitmask/mail/incoming/service.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/leap/bitmask/mail/incoming/service.py b/src/leap/bitmask/mail/incoming/service.py
index 1ab6df9..ddbdd2a 100644
--- a/src/leap/bitmask/mail/incoming/service.py
+++ b/src/leap/bitmask/mail/incoming/service.py
@@ -169,7 +169,7 @@ class IncomingMail(Service):
# XXX this should be moved to adaptors
d = self._soledad.get_from_index(
fields.JUST_MAIL_IDX, "1", "0")
- d.addCallback(self._process_doclist)
+ d.addCallback(self._process_incoming_mail)
d.addErrback(_sync_errback)
return d
@@ -260,9 +260,7 @@ class IncomingMail(Service):
emit_async(catalog.MAIL_UNREAD_MESSAGES, self._userid,
str(self._inbox_collection.count_unseen()))
- # process incoming mail.
-
- def _process_doclist(self, doclist):
+ def _process_incoming_mail(self, doclist):
"""
Iterates through the doclist, checks if each doc
looks like a message, and yields a deferred that will decrypt and
@@ -272,15 +270,16 @@ class IncomingMail(Service):
:type doclist: iterable.
:returns: a list of deferreds for individual messages.
"""
- logger.info('processing doclist')
+ logger.info('processing incoming mail')
if not doclist:
- logger.debug("no docs found")
+ logger.debug("no incoming messages found")
return
num_mails = len(doclist)
deferreds = []
for index, doc in enumerate(doclist):
- logger.debug("processing doc %d of %d" % (index + 1, num_mails))
+ logger.debug("processing incoming message: %d of %d"
+ % (index + 1, num_mails))
emit_async(catalog.MAIL_MSG_PROCESSING, self._userid,
str(index), str(num_mails))
@@ -297,7 +296,7 @@ class IncomingMail(Service):
DeprecationWarning)
if has_errors:
- logger.debug("skipping msg with decrypting errors...")
+ logger.debug("skipping message with decrypting errors...")
elif self._is_msg(keys):
# TODO this pipeline is a bit obscure!
d = self._decrypt_doc(doc)