Only check for reply markers at the beginning of each line

Otherwise we could cut the user's message if they use the ">" symbol in
their text.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-11-22 15:48:03 -05:00
parent 5cb66f7a7f
commit a0644d225c
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ thread_id = match.group(0).rsplit("=")[-1].rstrip()
# - Quoted text will always begin with ">"
# - The email reply will always have "Reply sent on <whenever>" text
#
message = re.sub(">(.*?)\n", "", payload).rstrip()
message = re.sub("^>(.*?)\n", "", payload, flags=re.MULTILINE).rstrip()
split = message.split("\n")
message = "\n".join(split[:-1]).rstrip()