diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-10 12:08:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-10 12:08:16 +0000 |
commit | 1fa79760ad2d4bd67f5c5a27f372a7533b9b7c69 (patch) | |
tree | ffdfbd9113743831ff4f1290959a62cf6567fde5 /app/services/notification_service.rb | |
parent | 82fa8a3d1e8466ef36b58604d20fcc145ea12118 (diff) | |
download | gitlab-ce-1fa79760ad2d4bd67f5c5a27f372a7533b9b7c69.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 6f2bfa8169b..6b92e5a5625 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -108,7 +108,7 @@ class NotificationService # * users with custom level checked with "reassign issue" # def reassigned_issue(issue, current_user, previous_assignees = []) - recipients = NotificationRecipientService.build_recipients( + recipients = NotificationRecipients::BuildService.build_recipients( issue, current_user, action: "reassign", @@ -161,7 +161,7 @@ class NotificationService def push_to_merge_request(merge_request, current_user, new_commits: [], existing_commits: []) new_commits = new_commits.map { |c| { short_id: c.short_id, title: c.title } } existing_commits = existing_commits.map { |c| { short_id: c.short_id, title: c.title } } - recipients = NotificationRecipientService.build_recipients(merge_request, current_user, action: "push_to") + recipients = NotificationRecipients::BuildService.build_recipients(merge_request, current_user, action: "push_to") recipients.each do |recipient| mailer.send(:push_to_merge_request_email, recipient.user.id, merge_request.id, current_user.id, recipient.reason, new_commits: new_commits, existing_commits: existing_commits).deliver_later @@ -197,7 +197,7 @@ class NotificationService # * users with custom level checked with "reassign merge request" # def reassigned_merge_request(merge_request, current_user, previous_assignees = []) - recipients = NotificationRecipientService.build_recipients( + recipients = NotificationRecipients::BuildService.build_recipients( merge_request, current_user, action: "reassign", @@ -260,7 +260,7 @@ class NotificationService end def resolve_all_discussions(merge_request, current_user) - recipients = NotificationRecipientService.build_recipients( + recipients = NotificationRecipients::BuildService.build_recipients( merge_request, current_user, action: "resolve_all_discussions") @@ -291,7 +291,7 @@ class NotificationService def send_new_note_notifications(note) notify_method = "note_#{note.noteable_ability_name}_email".to_sym - recipients = NotificationRecipientService.build_new_note_recipients(note) + recipients = NotificationRecipients::BuildService.build_new_note_recipients(note) recipients.each do |recipient| mailer.send(notify_method, recipient.user.id, note.id, recipient.reason).deliver_later end @@ -299,7 +299,7 @@ class NotificationService # Notify users when a new release is created def send_new_release_notifications(release) - recipients = NotificationRecipientService.build_new_release_recipients(release) + recipients = NotificationRecipients::BuildService.build_new_release_recipients(release) recipients.each do |recipient| mailer.new_release_email(recipient.user.id, release, recipient.reason).deliver_later @@ -413,7 +413,7 @@ class NotificationService end def issue_moved(issue, new_issue, current_user) - recipients = NotificationRecipientService.build_recipients(issue, current_user, action: 'moved') + recipients = NotificationRecipients::BuildService.build_recipients(issue, current_user, action: 'moved') recipients.map do |recipient| email = mailer.issue_moved_email(recipient.user, issue, new_issue, current_user, recipient.reason) @@ -490,7 +490,7 @@ class NotificationService end def issue_due(issue) - recipients = NotificationRecipientService.build_recipients( + recipients = NotificationRecipients::BuildService.build_recipients( issue, issue.author, action: 'due', @@ -526,7 +526,7 @@ class NotificationService protected def new_resource_email(target, method) - recipients = NotificationRecipientService.build_recipients(target, target.author, action: "new") + recipients = NotificationRecipients::BuildService.build_recipients(target, target.author, action: "new") recipients.each do |recipient| mailer.send(method, recipient.user.id, target.id, recipient.reason).deliver_later @@ -534,7 +534,7 @@ class NotificationService end def new_mentions_in_resource_email(target, new_mentioned_users, current_user, method) - recipients = NotificationRecipientService.build_recipients(target, current_user, action: "new") + recipients = NotificationRecipients::BuildService.build_recipients(target, current_user, action: "new") recipients = recipients.select {|r| new_mentioned_users.include?(r.user) } recipients.each do |recipient| @@ -545,7 +545,7 @@ class NotificationService def close_resource_email(target, current_user, method, skip_current_user: true, closed_via: nil) action = method == :merged_merge_request_email ? "merge" : "close" - recipients = NotificationRecipientService.build_recipients( + recipients = NotificationRecipients::BuildService.build_recipients( target, current_user, action: action, @@ -573,7 +573,7 @@ class NotificationService end def removed_milestone_resource_email(target, current_user, method) - recipients = NotificationRecipientService.build_recipients( + recipients = NotificationRecipients::BuildService.build_recipients( target, current_user, action: 'removed_milestone' @@ -585,7 +585,7 @@ class NotificationService end def changed_milestone_resource_email(target, milestone, current_user, method) - recipients = NotificationRecipientService.build_recipients( + recipients = NotificationRecipients::BuildService.build_recipients( target, current_user, action: 'changed_milestone' @@ -597,7 +597,7 @@ class NotificationService end def reopen_resource_email(target, current_user, method, status) - recipients = NotificationRecipientService.build_recipients(target, current_user, action: "reopen") + recipients = NotificationRecipients::BuildService.build_recipients(target, current_user, action: "reopen") recipients.each do |recipient| mailer.send(method, recipient.user.id, target.id, status, current_user.id, recipient.reason).deliver_later @@ -605,7 +605,7 @@ class NotificationService end def merge_request_unmergeable_email(merge_request) - recipients = NotificationRecipientService.build_merge_request_unmergeable_recipients(merge_request) + recipients = NotificationRecipients::BuildService.build_merge_request_unmergeable_recipients(merge_request) recipients.each do |recipient| mailer.merge_request_unmergeable_email(recipient.user.id, merge_request.id).deliver_later @@ -619,15 +619,15 @@ class NotificationService private def project_maintainers_recipients(target, action:) - NotificationRecipientService.build_project_maintainers_recipients(target, action: action) + NotificationRecipients::BuildService.build_project_maintainers_recipients(target, action: action) end def notifiable?(*args) - NotificationRecipientService.notifiable?(*args) + NotificationRecipients::BuildService.notifiable?(*args) end def notifiable_users(*args) - NotificationRecipientService.notifiable_users(*args) + NotificationRecipients::BuildService.notifiable_users(*args) end def deliver_access_request_email(recipient, member) |