summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-03-05 10:38:23 -0800
committerStan Hu <stanhu@gmail.com>2015-03-06 06:54:00 -0800
commit7e204cf389346d23e71bc4c2fa9e14cf82a7ed2e (patch)
treea0d85dcfb27c34aaede8c7183c9482248d6bee7f /app/services
parent8b53d9efe648f10e0572c2d8017489d0d3bb4755 (diff)
downloadgitlab-ce-7e204cf389346d23e71bc4c2fa9e14cf82a7ed2e.tar.gz
Added comment notification events to HipChat and Slack services.
Supports four different event types all bundled under the "note" event type: - comments on a commit - comments on an issue - comments on a merge request - comments on a code snippet
Diffstat (limited to 'app/services')
-rw-r--r--app/services/notes/create_service.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb
index f64006a4edc..e969061f229 100644
--- a/app/services/notes/create_service.rb
+++ b/app/services/notes/create_service.rb
@@ -17,10 +17,22 @@ module Notes
note.references.each do |mentioned|
Note.create_cross_reference_note(mentioned, note.noteable, note.author, note.project)
end
+
+ execute_hooks(note)
end
end
note
end
+
+ def hook_data(note)
+ Gitlab::NoteDataBuilder.build(note, current_user)
+ end
+
+ def execute_hooks(note)
+ note_data = hook_data(note)
+ # TODO: Support Webhooks
+ note.project.execute_services(note_data, :note_hooks)
+ end
end
end