FIX: user_id arg override in Slack import (#22713)

Fixes `user_id` arg override during mention parsing.
This commit is contained in:
Selase Krakani 2023-07-20 11:22:43 +00:00 committed by GitHub
parent 6c8dcdb30c
commit c90e399003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,9 +252,9 @@ class ImportScripts::Slack < ImportScripts::Base
# Mentions # Mentions
text.gsub!(/<@(\w+)>/) do text.gsub!(/<@(\w+)>/) do
user_id = $1 mentioned_user_id = $1
username = @lookup.find_username_by_import_id(user_id) username = @lookup.find_username_by_import_id(mentioned_user_id)
username ? "@#{username}" : "`@#{user_id}`" username ? "@#{username}" : "`@#{mentioned_user_id}`"
end end
# Links # Links