Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/participable.rb')
-rw-r--r--app/models/concerns/participable.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/participable.rb b/app/models/concerns/participable.rb
index f59b5d1ecc8..8130adf05f1 100644
--- a/app/models/concerns/participable.rb
+++ b/app/models/concerns/participable.rb
@@ -109,6 +109,7 @@ module Participable
when User
participants << source
when Participable
+ next if skippable_system_notes?(source, participants)
next unless !verify_access || source_visible_to_user?(source, current_user)
source.class.participant_attrs.each do |attr|
@@ -133,6 +134,13 @@ module Participable
participants.merge(extractor.users)
end
+ def skippable_system_notes?(source, participants)
+ source.is_a?(Note) &&
+ source.system? &&
+ source.author.in?(participants) &&
+ !source.note.match?(User.reference_pattern)
+ end
+
def use_internal_notes_extractor_for?(source)
source.is_a?(Note) && source.confidential?
end