Commit a6c673d8 authored by Eugenia Grieff's avatar Eugenia Grieff

Fix failing specs

parent ce963d21
......@@ -43,11 +43,12 @@ module Gitlab
message, stripped_text = ReplyParser.new(mail, **kwargs).execute
message = message.strip
message_with_attachments = add_attachments(message)
# Support bot is specifically forbidden from using slash commands.
message = strip_quick_actions(message)
message = append_reply(message, stripped_text) if kwargs[:append_reply]
message = strip_quick_actions(message_with_attachments)
return message unless kwargs[:append_reply]
add_attachments(message)
append_reply(message, stripped_text)
end
def add_attachments(reply)
......
......@@ -28,8 +28,9 @@ module Gitlab
return "" if body.lines.all? { |l| l.strip.empty? || l.start_with?('>') }
encoded_body = body.force_encoding(encoding).encode("UTF-8")
return encoded_body unless @append_reply
@append_reply ? [encoded_body, stripped_text] : encoded_body
[encoded_body, stripped_text.force_encoding(encoding).encode("UTF-8")]
end
private
......@@ -70,13 +71,6 @@ module Gitlab
rescue StandardError
nil
end
# def trim_reply(text, append_trimmed_reply: false)
# trimmed_body, stripped_text = EmailReplyTrimmer.trim(text, append_trimmed_reply)
# return trimmed_body if trimmed_body.blank? || stripped_text.blank?
# trimmed_body + "\n\n<details><summary>...</summary>\n\n#{stripped_text}\n\n</details>"
# end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment