diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-01-17 11:01:45 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-01-22 12:01:22 +0000 |
commit | 6dc2c6fde65b6f521e5b9e18b0cbeb33a7e156c5 (patch) | |
tree | 9b3606dcfcbbe1a1437ad9d9b7ab95efe547d3a2 /app/models/incoming_message.rb | |
parent | a6b40e039aca35e011e9e106f6a791ffa4b555db (diff) |
Handle gmail-style quoting from the HTML part of a mail.
We already handled this type of quoting when coming directly from a text
part of a mail, but when we choose the HTML part as the main part and
then convert it to text, the 'On [date] <email> person said:' part can
get split over two lines.
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r-- | app/models/incoming_message.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index bcf0b6ec9..59e61952e 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -385,6 +385,10 @@ class IncomingMessage < ActiveRecord::Base multiline_original_message = '(' + '''>>>.* \d\d/\d\d/\d\d\d\d\s+\d\d:\d\d(?::\d\d)?\s*>>>''' + ')' text.gsub!(/^(#{multiline_original_message}\n.*)$/m, replacement) + # On Thu, Nov 28, 2013 at 9:08 AM, A User + # <[1]request-7-skm40s2ls@xxx.xxxx> wrote: + text.gsub!(/^( On [^\n]+\n\s*\<[^>\n]+\> (wrote|said):\s*\n.*)$/m, replacement) + # Single line sections text.gsub!(/^(>.*\n)/, replacement) text.gsub!(/^(On .+ (wrote|said):\n)/, replacement) |