Skip to content

Commit

Permalink
Normalize emojis with variant selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEssem authored and jordemort committed Sep 3, 2024
1 parent 8f4ff90 commit 05f1606
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/services/react_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ def call(account, status, emoji)
name, domain = emoji.split('@')
return unless domain.nil? || status.local?

normalized = "#{name}\uFE0F"
name = normalized if StatusReactionValidator::SUPPORTED_EMOJIS.include?(normalized)

custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain)
reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji)
return reaction unless reaction.nil?
Expand Down

0 comments on commit 05f1606

Please sign in to comment.