summaryrefslogtreecommitdiff
path: root/src/leap/mail/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/mail/utils.py')
-rw-r--r--src/leap/mail/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/leap/mail/utils.py b/src/leap/mail/utils.py
index 1f43947..6a1fcde 100644
--- a/src/leap/mail/utils.py
+++ b/src/leap/mail/utils.py
@@ -21,6 +21,8 @@ import json
import re
import traceback
+from leap.soledad.common.document import SoledadDocument
+
CHARSET_PATTERN = r"""charset=([\w-]+)"""
CHARSET_RE = re.compile(CHARSET_PATTERN, re.IGNORECASE)
@@ -42,6 +44,8 @@ def empty(thing):
"""
if thing is None:
return True
+ if isinstance(thing, SoledadDocument):
+ thing = thing.content
try:
return len(thing) == 0
except ReferenceError: