summaryrefslogtreecommitdiff
path: root/app/services/notification_recipients
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/notification_recipients')
-rw-r--r--app/services/notification_recipients/build_service.rb4
-rw-r--r--app/services/notification_recipients/builder/attention_requested.rb23
2 files changed, 27 insertions, 0 deletions
diff --git a/app/services/notification_recipients/build_service.rb b/app/services/notification_recipients/build_service.rb
index 52070abbad7..aeb859af4d9 100644
--- a/app/services/notification_recipients/build_service.rb
+++ b/app/services/notification_recipients/build_service.rb
@@ -40,5 +40,9 @@ module NotificationRecipients
def self.build_requested_review_recipients(*args)
::NotificationRecipients::Builder::RequestReview.new(*args).notification_recipients
end
+
+ def self.build_attention_requested_recipients(*args)
+ ::NotificationRecipients::Builder::AttentionRequested.new(*args).notification_recipients
+ end
end
end
diff --git a/app/services/notification_recipients/builder/attention_requested.rb b/app/services/notification_recipients/builder/attention_requested.rb
new file mode 100644
index 00000000000..cdc371fcece
--- /dev/null
+++ b/app/services/notification_recipients/builder/attention_requested.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module NotificationRecipients
+ module Builder
+ class AttentionRequested < Base
+ attr_reader :merge_request, :current_user, :user
+
+ def initialize(merge_request, current_user, user)
+ @merge_request = merge_request
+ @current_user = current_user
+ @user = user
+ end
+
+ def target
+ merge_request
+ end
+
+ def build!
+ add_recipients(user, :mention, NotificationReason::ATTENTION_REQUESTED)
+ end
+ end
+ end
+end