From 8b1c630d83e2c2ee436d47a6e15892124d2e18f3 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Fri, 12 Nov 2021 07:38:12 -0800 Subject: [PATCH] remove subject from delta chat messsages --- email2post.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/email2post.py b/email2post.py index ca5be26..1865acd 100755 --- a/email2post.py +++ b/email2post.py @@ -62,11 +62,18 @@ def parse(data, pnut, mstdn): msg.append(line) body = '\n'.join(msg) + deltac = data.get('Chat-Version') + if deltac is None: + subject = data['Subject'] + else: + logger.debug(f"Chat-Version: {deltac}") + subject = "" + if pnut: - post_pnut(data['Subject'], body, attachments) + post_pnut(subject, body, attachments) if mstdn: - post_mastodon(data['Subject'], body, attachments) + post_mastodon(subject, body, attachments) def post_pnut(title, text, attachments): post = {'text': text, 'raw': []}