diff options
Diffstat (limited to 'app/models/project_services/slack_service.rb')
-rw-r--r-- | app/models/project_services/slack_service.rb | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/app/models/project_services/slack_service.rb b/app/models/project_services/slack_service.rb index 79245e84238..abe799bdff5 100644 --- a/app/models/project_services/slack_service.rb +++ b/app/models/project_services/slack_service.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class SlackService < ChatNotificationService + include SlackMattermost::Notifier + prop_accessor EVENT_CHANNEL['alert'] def title @@ -35,27 +37,4 @@ class SlackService < ChatNotificationService super end - - module Notifier - private - - def notify(message, opts) - # See https://gitlab.com/gitlab-org/slack-notifier/#custom-http-client - notifier = Slack::Messenger.new(webhook, opts.merge(http_client: HTTPClient)) - notifier.ping( - message.pretext, - attachments: message.attachments, - fallback: message.fallback - ) - end - - class HTTPClient - def self.post(uri, params = {}) - params.delete(:http_options) # these are internal to the client and we do not want them - Gitlab::HTTP.post(uri, body: params) - end - end - end - - include Notifier end |