diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-22 12:10:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-22 12:10:03 +0000 |
commit | 74b99c4264411703dedaf2d24cec2e6a5de6337d (patch) | |
tree | a36ce9dccc64043c37f8cb8ace0236d323ea44bc /app/models/concerns/participable.rb | |
parent | 2763994b8f9e44c8ee9bd7197622e6bcba00a4db (diff) | |
download | gitlab-ce-74b99c4264411703dedaf2d24cec2e6a5de6337d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/participable.rb')
-rw-r--r-- | app/models/concerns/participable.rb | 8 |
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 |