FIX: Muted/Ignore should prevent PMs regardless of case sensitivity

This commit is contained in:
Robin Ward
2020-06-17 14:26:14 -04:00
parent 81a3129ffb
commit e8756e1a95
2 changed files with 15 additions and 3 deletions

View File

@ -96,7 +96,7 @@ class PostCreator
end
if @opts[:target_usernames].present? && !skip_validations? && !@user.staff?
names = @opts[:target_usernames].split(',')
names = @opts[:target_usernames].split(',').flatten.map(&:downcase)
# Make sure max_allowed_message_recipients setting is respected
max_allowed_message_recipients = SiteSetting.max_allowed_message_recipients
@ -111,7 +111,7 @@ class PostCreator
end
# Make sure none of the users have muted the creator
users = User.where(username: names).pluck(:id, :username).to_h
users = User.where(username_lower: names).pluck(:id, :username).to_h
User
.joins("LEFT JOIN user_options ON user_options.user_id = users.id")