diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-04-08 06:11:31 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-04-08 06:11:31 +0000 |
commit | 3d1cade13f61115b63bf6dbda5a1f194ba54b24b (patch) | |
tree | e9edc13dbd28ba1eb4bbeb995f596ead2ad28b2c /lib | |
parent | 4040776430c2bbef689924c206e2c2c46428e4ef (diff) | |
parent | f058b52b50c76de9557b167a1a31a5c9ba446f31 (diff) | |
download | gitlab-ce-3d1cade13f61115b63bf6dbda5a1f194ba54b24b.tar.gz |
Merge branch 'new-resolvable-discussion' into 'master'
Add option to start a new resolvable discussion in an MR
Closes #24378
See merge request !7527
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/line.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/email/handler/create_note_handler.rb | 13 |
2 files changed, 5 insertions, 12 deletions
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb index 114656958e3..0a15c6d9358 100644 --- a/lib/gitlab/diff/line.rb +++ b/lib/gitlab/diff/line.rb @@ -33,6 +33,10 @@ module Gitlab new_pos unless removed? || meta? end + def line + new_line || old_line + end + def unchanged? type.nil? end diff --git a/lib/gitlab/email/handler/create_note_handler.rb b/lib/gitlab/email/handler/create_note_handler.rb index d87ba427f4b..0e22f2189ee 100644 --- a/lib/gitlab/email/handler/create_note_handler.rb +++ b/lib/gitlab/email/handler/create_note_handler.rb @@ -1,4 +1,3 @@ - require 'gitlab/email/handler/base_handler' require 'gitlab/email/handler/reply_processing' @@ -42,17 +41,7 @@ module Gitlab end def create_note - Notes::CreateService.new( - project, - author, - note: message, - noteable_type: sent_notification.noteable_type, - noteable_id: sent_notification.noteable_id, - commit_id: sent_notification.commit_id, - line_code: sent_notification.line_code, - position: sent_notification.position, - type: sent_notification.note_type - ).execute + sent_notification.create_reply(message) end end end |