[1/2] Keep signature delimiters intact in notifications

Message ID 20200130122453.28262-1-lfleischer@archlinux.org
State New
Headers show
Series [1/2] Keep signature delimiters intact in notifications | expand

Commit Message

Lukas Fleischer Jan. 30, 2020, 12:24 p.m. UTC
Since commit eeaa1c3 (Separate text from footer in notification emails,
2020-01-04), information about unsubscribing from notifications is added
in a signature block. However, the code to format the email body trimmed
the RFC 3676 signature delimiter, replacing "-- " by "--". Fix this by
adding a special case for signature delimiters.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
---
 aurweb/scripts/notify.py | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py
index 6c3be22..f2767fd 100755
--- a/aurweb/scripts/notify.py
+++ b/aurweb/scripts/notify.py
@@ -54,6 +54,9 @@  class Notification:
     def get_body_fmt(self, lang):
         body = ''
         for line in self.get_body(lang).splitlines():
+            if line == '-- ':
+                body += '-- \n'
+                continue
             body += textwrap.fill(line, break_long_words=False) + '\n'
         for i, ref in enumerate(self.get_refs()):
             body += '\n' + '[%d] %s' % (i + 1, ref)