comparison roundup/mailgw.py @ 4581:f1d6e2b2eb64

Fix quote-stripping in mail gateway again. Keep non-quoted first line of quoted section only if it ends in ':'.
author Ralf Schlatterbeck <rsc@runtux.com>
date Thu, 05 Jan 2012 22:20:11 +0100
parents 782737d1a2d7
children 6e9b9743de89
comparison
equal deleted inserted replaced
4580:782737d1a2d7 4581:f1d6e2b2eb64
1790 quote_1st = lines[0] and lines[0][0] in '>|' 1790 quote_1st = lines[0] and lines[0][0] in '>|'
1791 quote_2nd = len(lines) > 1 and lines[1] and lines[1][0] in '>|' 1791 quote_2nd = len(lines) > 1 and lines[1] and lines[1][0] in '>|'
1792 if quote_1st or quote_2nd: 1792 if quote_1st or quote_2nd:
1793 # don't drop non-quoted first line of intermediate section: 1793 # don't drop non-quoted first line of intermediate section:
1794 if ns and not quote_1st and lines[0] and not keep_citations: 1794 if ns and not quote_1st and lines[0] and not keep_citations:
1795 l.append(lines[0]) 1795 # we drop only first-lines ending in ':' (e.g. 'XXX wrote:')
1796 if not lines[0].endswith(':'):
1797 l.append(lines[0])
1796 # see if there's a response somewhere inside this section (ie. 1798 # see if there's a response somewhere inside this section (ie.
1797 # no blank line between quoted message and response) 1799 # no blank line between quoted message and response)
1798 for n, line in enumerate(lines[1:]): 1800 for n, line in enumerate(lines[1:]):
1799 if line and line[0] not in '>|': 1801 if line and line[0] not in '>|':
1800 break 1802 break

Roundup Issue Tracker: http://roundup-tracker.org/