summaryrefslogtreecommitdiff
path: root/alot/db/message.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2019-08-10 18:29:43 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2019-08-15 11:33:04 +0100
commit7eaaaf6e0f0acfe754aaad4d07cbd83980151665 (patch)
tree50aa90d5f7dc6d8da24389359c1a95550491f319 /alot/db/message.py
parentd41927f23614321ae6f711ebd356808264ecd6c6 (diff)
retire Message.accumulate_body
... in favour of get_body_text to de-clutter the Message class. The functionality is implemented in alot.db.utils.extract_body, which now contains the hard-coding of the html warning.
Diffstat (limited to 'alot/db/message.py')
-rw-r--r--alot/db/message.py25
1 files changed, 2 insertions, 23 deletions
diff --git a/alot/db/message.py b/alot/db/message.py
index f756e349..0926e9f4 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -18,11 +18,6 @@ from ..settings.const import settings
charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
-MISSING_HTML_MSG = ("This message contains a text/html part that was not "
- "rendered due to a missing mailcap entry. "
- "Please refer to item 5 in our FAQ: "
- "http://alot.rtfd.io/en/latest/faq.html")
-
@functools.total_ordering
class Message:
@@ -265,25 +260,9 @@ class Message:
self._attachments.append(Attachment(part))
return self._attachments
- def accumulate_body(self):
- """
- returns bodystring extracted from this mail
- """
- # TODO: allow toggle commands to decide which part is considered body
- eml = self.get_email()
- bodytext = self.get_body_text()
-
- # check if extracted body is empty dispite having a text/html body part
- if eml is not None:
- bodypart = eml.get_body()
- if (bodypart and
- bodypart.get_payload() and
- eml.get_content_type() == 'text/html' and
- not bodytext):
- bodytext = MISSING_HTML_MSG
- return bodytext
-
def get_body_text(self):
+ """ returns bodystring extracted from this mail """
+ # TODO: allow toggle commands to decide which part is considered body
return extract_body(self.get_email())
def matches(self, querystring):