Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/email/handler/create_note_handler.rb')
-rw-r--r--lib/gitlab/email/handler/create_note_handler.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/email/handler/create_note_handler.rb b/lib/gitlab/email/handler/create_note_handler.rb
index 28200643296..4fa2fe1724e 100644
--- a/lib/gitlab/email/handler/create_note_handler.rb
+++ b/lib/gitlab/email/handler/create_note_handler.rb
@@ -5,6 +5,7 @@ require 'gitlab/email/handler/reply_processing'
# handles note/reply creation emails with these formats:
# incoming+1234567890abcdef1234567890abcdef@incoming.gitlab.com
+# Quoted material is _not_ stripped but appended as a `details` section
module Gitlab
module Email
module Handler
@@ -24,7 +25,7 @@ module Gitlab
validate_permission!(:create_note)
raise NoteableNotFoundError unless noteable
- raise EmptyEmailError if message.blank?
+ raise EmptyEmailError if note_message.blank?
verify_record!(
record: create_note,
@@ -47,7 +48,13 @@ module Gitlab
end
def create_note
- sent_notification.create_reply(message)
+ sent_notification.create_reply(note_message)
+ end
+
+ def note_message
+ return message unless sent_notification.noteable_type == "Issue"
+
+ message_with_appended_reply
end
end
end