summaryrefslogtreecommitdiff
path: root/lib/gitlab/data_builder
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-04-03 11:00:33 +0000
committerJames Lopez <james@jameslopez.es>2018-04-05 08:41:56 +0200
commit52967b107b7b2f1472b4c005f70f21346079cd95 (patch)
tree12e99d4fe27f69af53920bd4db3a81e473def642 /lib/gitlab/data_builder
parent98106ec54e439455f545f3df15332a28b9b0c969 (diff)
downloadgitlab-ce-52967b107b7b2f1472b4c005f70f21346079cd95.tar.gz
Merge branch 'jej/mattermost-notification-confidentiality-10-6' into 'security-10-6'
[10.6] Prevent notes on confidential issues from being sent to chat See merge request gitlab/gitlabhq!2366 # Conflicts: # app/helpers/services_helper.rb
Diffstat (limited to 'lib/gitlab/data_builder')
-rw-r--r--lib/gitlab/data_builder/note.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/data_builder/note.rb b/lib/gitlab/data_builder/note.rb
index 50fea1232af..f573368e572 100644
--- a/lib/gitlab/data_builder/note.rb
+++ b/lib/gitlab/data_builder/note.rb
@@ -9,6 +9,7 @@ module Gitlab
#
# data = {
# object_kind: "note",
+ # event_type: "confidential_note",
# user: {
# name: String,
# username: String,
@@ -51,8 +52,11 @@ module Gitlab
end
def build_base_data(project, user, note)
+ event_type = note.confidential? ? 'confidential_note' : 'note'
+
base_data = {
object_kind: "note",
+ event_type: event_type,
user: user.hook_attrs,
project_id: project.id,
project: project.hook_attrs,