diff options
Diffstat (limited to 'app/services/quick_actions/interpret_service.rb')
-rw-r--r-- | app/services/quick_actions/interpret_service.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index 1baa4ddf0eb..47f4b9c6898 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -77,7 +77,10 @@ module QuickActions # want to also handle bare usernames. The ReferenceExtractor also has # different behaviour, and will return all group members for groups named # using a user-style reference, which is not in scope here. + # + # nb: underscores may be passed in escaped to protect them from markdown rendering args = params.split(/\s|,/).select(&:present?).uniq - ['and'] + args.map! { _1.gsub(/\\_/, '_') } usernames = (args - ['me']).map { _1.delete_prefix('@') } found = User.by_username(usernames).to_a.select { can?(:read_user, _1) } found_names = found.map(&:username).to_set @@ -168,7 +171,7 @@ module QuickActions next unless definition definition.execute(self, arg) - usage_ping_tracking(name, arg) + usage_ping_tracking(definition.name, arg) end end @@ -186,7 +189,7 @@ module QuickActions def usage_ping_tracking(quick_action_name, arg) Gitlab::UsageDataCounters::QuickActionActivityUniqueCounter.track_unique_action( - quick_action_name, + quick_action_name.to_s, args: arg&.strip, user: current_user ) |