X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2d7e0a397a1b2dbed74f40439c1305b1b48a063e..e37c877da51947cb24af4d046fd71a597bf24ba9:/app/controllers/api/notes_controller.rb diff --git a/app/controllers/api/notes_controller.rb b/app/controllers/api/notes_controller.rb index c141bdf46..7e2e7fb79 100644 --- a/app/controllers/api/notes_controller.rb +++ b/app/controllers/api/notes_controller.rb @@ -398,8 +398,10 @@ module Api comment = note.comments.create!(attributes) - note.comments.map(&:author).uniq.each do |user| - UserMailer.note_comment_notification(comment, user).deliver_later if notify && user && user != current_user && user.visible? + if notify + note.subscribers.visible.each do |user| + UserMailer.note_comment_notification(comment, user).deliver_later if current_user != user + end end NoteSubscription.find_or_create_by(:note => note, :user => current_user) if current_user