From 36653928f77bcc8e47dd67d18fe44d23281fc8b9 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Tue, 6 Apr 2021 20:38:21 -0400 Subject: [PATCH] add html API --- python/src/deltachat/message.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/python/src/deltachat/message.py b/python/src/deltachat/message.py index 4b320da24..774c76cf6 100644 --- a/python/src/deltachat/message.py +++ b/python/src/deltachat/message.py @@ -86,6 +86,23 @@ class Message(object): """set text of this message. """ lib.dc_msg_set_text(self._dc_msg, as_dc_charpointer(text)) + @props.with_doc + def html(self): + """html text of this messages (might be empty if not an html message). """ + return from_dc_charpointer( + lib.dc_get_msg_html(self.account._dc_context, self.id)) or "" + + def has_html(self): + """return True if this message has an html part, False otherwise.""" + return lib.dc_msg_has_html(self._dc_msg) + + def set_html(self, html_text): + """set the html part of this message. + + It is possible to have text and html part at the same time. + """ + lib.dc_msg_set_html(self._dc_msg, as_dc_charpointer(html_text)) + @props.with_doc def filename(self): """filename if there was an attachment, otherwise empty string. """