diff options
author | Cameron Crockett <cameron@ccrockett.com> | 2018-05-09 23:19:16 +0300 |
---|---|---|
committer | Cameron Crockett <cameron@ccrockett.com> | 2018-05-23 07:05:51 +0300 |
commit | 421dbb1746e7944a578d2dc894ae3975dac94ac8 (patch) | |
tree | b7dc90958be9f94ffe0f57bb56b5a590f21c02d1 /lib/gitlab/email/reply_parser.rb | |
parent | 76e276cb433a7023cf8154f9d9555725b3b11e67 (diff) |
skip email trim when email is creating new issue
Updates from MR discussion
1. Added test for ReplyParser
2. Changed param to trim_reply with default set as true
Removed keyword param in favor of normal options param
updates for MR discussion
Resolutions for code review comments
more code review fixes
Diffstat (limited to 'lib/gitlab/email/reply_parser.rb')
-rw-r--r-- | lib/gitlab/email/reply_parser.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/email/reply_parser.rb b/lib/gitlab/email/reply_parser.rb index 01c28d051ee..ae6b84607d6 100644 --- a/lib/gitlab/email/reply_parser.rb +++ b/lib/gitlab/email/reply_parser.rb @@ -4,8 +4,9 @@ module Gitlab class ReplyParser attr_accessor :message - def initialize(message) + def initialize(message, trim_reply: true) @message = message + @trim_reply = trim_reply end def execute @@ -13,7 +14,9 @@ module Gitlab encoding = body.encoding - body = EmailReplyTrimmer.trim(body) + if @trim_reply + body = EmailReplyTrimmer.trim(body) + end return '' unless body |