[PATCH 1/2] Keep signature delimiters intact in notifications
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(+) 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) -- 2.25.0
Since commit eeaa1c3 (Separate text from footer in notification emails, 2020-01-04), information about unsubscribing from notifications is added in a signature block. Fix the test cases accordingly. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- test/t2500-notify.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/t2500-notify.sh b/test/t2500-notify.sh index 3080dc2..380e65b 100755 --- a/test/t2500-notify.sh +++ b/test/t2500-notify.sh @@ -101,6 +101,7 @@ test_expect_success 'Test subject and body of comment notifications.' ' This is a test comment. + -- If you no longer wish to receive notifications about this package, please go to the package page [2] and select "Disable notifications". @@ -126,6 +127,7 @@ test_expect_success 'Test subject and body of update notifications.' ' cat <<-EOD >expected && user [1] pushed a new commit to foobar [2]. + -- If you no longer wish to receive notifications about this package, please go to the package page [2] and select "Disable notifications". @@ -264,6 +266,7 @@ test_expect_success 'Test subject and body of merge notifications.' ' cat <<-EOD >expected && user [1] merged foobar [2] into foobar2 [3]. + -- If you no longer wish receive notifications about the new package, please go to [3] and click "Disable notifications". -- 2.25.0
participants (1)
-
Lukas Fleischer