Commit 273cd9c3 authored by http://jneen.net/'s avatar http://jneen.net/

remove build_relabeled_recipients

parent eaa503d6
...@@ -14,10 +14,6 @@ module NotificationRecipientService ...@@ -14,10 +14,6 @@ module NotificationRecipientService
Builder::Default.new(*a).recipient_users Builder::Default.new(*a).recipient_users
end end
def self.build_relabeled_recipients(*a)
Builder::Relabeled.new(*a).recipient_users
end
def self.build_new_note_recipients(*a) def self.build_new_note_recipients(*a)
Builder::NewNote.new(*a).recipient_users Builder::NewNote.new(*a).recipient_users
end end
...@@ -246,21 +242,6 @@ module NotificationRecipientService ...@@ -246,21 +242,6 @@ module NotificationRecipientService
end end
end end
class Relabeled < Base
attr_reader :target
attr_reader :current_user
attr_reader :labels
def initialize(target, current_user, labels:)
@target = target
@current_user = current_user
@labels = labels
end
def build!
add_labels_subscribers(labels: labels)
end
end
class NewNote < Base class NewNote < Base
attr_reader :note attr_reader :note
def initialize(note) def initialize(note)
......
...@@ -368,7 +368,13 @@ class NotificationService ...@@ -368,7 +368,13 @@ class NotificationService
end end
def relabeled_resource_email(target, labels, current_user, method) def relabeled_resource_email(target, labels, current_user, method)
recipients = NotificationRecipientService.build_relabeled_recipients(target, current_user, labels: labels) recipients = labels.flat_map { |l| l.subscribers(target.project) }
recipients = NotificationRecipientService.notifiable_users(
recipients, :subscription,
target: target,
acting_user: current_user,
)
label_names = labels.map(&:name) label_names = labels.map(&:name)
recipients.each do |recipient| recipients.each do |recipient|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment